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@echo off
setlocal
setlocal EnableDelayedExpansion
SET PATH=%PATH%;%~dp0\Tools
set GIT=None
set WorkingCopyPath=%~dp0
set REVISIONNUMBER=Unknown
for /f "tokens=1-2*" %%A in ('reg query HKEY_LOCAL_MACHINE\Software\GitForWindows /v InstallPath ^| find "REG_SZ"') do (
set GIT=%%C
set "PATH=!GIT!\bin;%PATH%"
)
if exist "!GIT!\bin\git.exe" (
echo Found Git at !GIT!
goto GITFOUND
) else (
echo GIT NOT FOUND^^!
goto MENU
)
:GITFOUND
echo ---------------------------
echo Retrieving GIT Commit Count
echo ---------------------------
for /f "delims=" %%i in ('git rev-list HEAD --count') do (
set "REVISIONNUMBER=%%i"
)
:MENU
cd /d %~dp0
cls
chgcolor 0a
echo ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
echoj $ba
chgcolor 0f
echoj " GoldenEye TC GIT Build Compiler "
chgcolor 0a
chgcolor 0a
echoj $ba $0a
echo ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ
chgcolor 07
echo.
echoj "Current Path Is: "
chgcolor 0b
echo %~dp0
chgcolor 07
echoj "Current GIT Revision: "
chgcolor 0c
echo %REVISIONNUMBER%
echo.
chgcolor 0f
echoj "1. "
chgcolor 0e
echo Build Local Development Version
chgcolor 0f
echoj "2. "
chgcolor 0e
echoj "Build GIT Release "
echo.
chgcolor 0f
echoj "3. "
chgcolor 03
echo Quit
chgcolor 07
echo.
CHOICE /C 1234567 /N /M "Choose Option (Number Keys):"
IF ERRORLEVEL 3 GOTO LEAVE
IF ERRORLEVEL 2 GOTO SVNCOREFULL
IF ERRORLEVEL 1 GOTO DEVCORE
:DEVCORE
echo Compiling GoldenEye TC Local Development Build...
del .\builds\GE007_MPTC-DEV.pk3 /q
cd pk3
7za a -y -tzip -mx=0 -mmt -x^^!.git -xr^^!*.backup* -xr^^!*.dbs ..\builds\GE007_MPTC-DEV.pk3 .\
pause
goto MENU
:SVNCOREFULL
echo Compiling GoldenEye TC GIT Release Rev#: %REVISIONNUMBER% (Full Compression)...
del .\builds\GE007_MPTC-r%REVISIONNUMBER%.pk3 /q
cd pk3
7za a -y -tzip -mx=9 -mmt -x^^!.git -xr^^!*.backup* -xr^^!*.dbs ..\builds\GE007_MPTC-r%REVISIONNUMBER%.pk3 .\
pause
goto MENU
:LEAVE
cls
echo.
chgcolor 0a
echo Thanks for trying my batch script! - Jordon Moss (aka. Striker The Hedgefox)
chgcolor 0b
echo Found any bugs? E-Mail me at mossj32@gmail.com
echo or post @ http://shadowmavericks.com/forums/
chgcolor 0e
timeout 5