forked from Thunder-Engine-Dev/te-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
manage.bat
158 lines (124 loc) · 2.82 KB
/
manage.bat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
@echo off
setlocal EnableDelayedExpansion
goto init
:ask
echo(
:init
echo [95mChoose the action you want to run:[0m
echo(
echo [94m1.[0m Update project and engine with reset
echo [94m2.[0m Update project and engine
echo(
echo [94m3.[0m Update project with reset
echo [94m4.[0m Update project
echo(
echo [94m5.[0m Update engine with reset
echo [94m6.[0m Update engine
echo(
echo [94m7.[0m Project diff
echo [94m8.[0m Engine diff
echo(
echo [94m9.[0m Project commit
echo [94m10.[0m Engine commit (if you have permission to do so)
echo(
set /p userInput=Enter your choice:
echo(
if /i "%userInput%"=="1" (
echo [91mThis action will destroy all uncommited data. Press enter to proceed.[0m
echo(
set /p a=
echo [95mPerforming resets...[0m
echo(
echo [95mProject:[0m
git reset --hard
cd engine
echo [95mEngine:[0m
git reset --hard
cd ..
echo(
echo [95mPulling the project updates...[0m
echo(
git pull
echo(
echo [95mUpdating the engine submodule...[0m
echo(
git submodule update --remote
goto end
) else if /i "%userInput%"=="2" (
echo [95mPulling the project updates...[0m
echo(
git pull
echo(
echo [95mUpdating the engine submodule...[0m
echo(
git submodule update --remote
goto end
) else if /i "%userInput%"=="3" (
echo [91mThis action will destroy all uncommited data in the project. Press enter to proceed.[0m
echo(
set /p a=
echo [95mPerforming resets...[0m
echo(
git reset --hard
echo(
echo [95mPulling the project updates...[0m
echo(
git pull
goto end
) else if /i "%userInput%"=="4" (
echo [95mPulling the project updates...[0m
echo(
git pull
goto end
) else if /i "%userInput%"=="5" (
echo [91mThis action will destroy all uncommited data in the engine. Press enter to proceed.[0m
echo(
set /p a=
echo [95mPerforming engine reset...[0m
echo(
cd engine
git reset --hard
cd ..
echo(
echo [95mUpdating the engine submodule...[0m
echo(
git submodule update --remote
goto end
) else if /i "%userInput%"=="6" (
echo [95mUpdating the engine submodule...[0m
echo(
git submodule update --remote
goto end
) else if /i "%userInput%"=="7" (
git add .
git diff --staged
goto ask
) else if /i "%userInput%"=="8" (
cd engine
git add .
git diff --staged
cd ..
goto ask
) else if /i "%userInput%"=="9" (
set /p commitName=Enter the project commit name:
git add .
git commit -m "!commitName!"
git push
goto ask
) else if /i "%userInput%"=="10" (
set /p commitName=Enter the engine commit name:
cd engine
git add .
git commit -m "!commitName!"
git push origin HEAD:main
cd ..
goto ask
) else (
echo [91mInvalid input. Please enter a number.[0m
goto ask
)
:end
echo(
echo [95mReview the changes and press enter to exit.[0m
echo(
set /p a=