Xeno443 commited on
Commit
9763a10
·
verified ·
1 Parent(s): 4c06e12

Upload switch-branch.bat

Browse files
Files changed (1) hide show
  1. runscripts/switch-branch.bat +55 -0
runscripts/switch-branch.bat ADDED
@@ -0,0 +1,55 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ @echo off
2
+ call environment.bat
3
+
4
+ :ask_branch
5
+ echo.
6
+ echo Which branch do you want to switch to?
7
+ echo 1 = main
8
+ echo 2 = dev
9
+ echo 3 = dev2
10
+ echo 4 = newmain_newforge
11
+ echo 5 = newforge_dendev
12
+
13
+ set /p PT_CHOICE=Enter choice:
14
+
15
+ if "%PT_CHOICE%"=="1" (
16
+ SET cbranch=main
17
+ GOTO :pullit
18
+ )
19
+ if "%PT_CHOICE%"=="2" (
20
+ SET cbranch=dev
21
+ GOTO :pullit
22
+ )
23
+ if "%PT_CHOICE%"=="3" (
24
+ SET cbranch=dev2
25
+ GOTO :pullit
26
+ )
27
+ if "%PT_CHOICE%"=="4" (
28
+ SET cbranch=newmain_newforge
29
+ GOTO :pullit
30
+ )
31
+ if "%PT_CHOICE%"=="5" (
32
+ SET cbranch=newforge_dendev
33
+ GOTO :pullit
34
+ )
35
+
36
+ echo Invalid choice.
37
+ GOTO ask_branch
38
+
39
+
40
+ :pullit
41
+ ECHO Switching to branch %cbranch% ...
42
+ git -C "%~dp0webui" checkout %cbranch%
43
+
44
+ ECHO Pulling files ...
45
+ git -C "%~dp0webui" pull
46
+ if %ERRORLEVEL% == 0 goto :done
47
+
48
+ ECHO Conflict detected, trying hard reset and pull ...
49
+ git -C "%~dp0webui" reset --hard
50
+ git -C "%~dp0webui" pull
51
+
52
+ :done
53
+ ECHO finished
54
+ pause
55
+