Skip to content

Commit

Permalink
Add script to install two versions of AMAI into a map
Browse files Browse the repository at this point in the history
  • Loading branch information
Slayer95 authored and SMUnlimited committed Nov 18, 2024
1 parent 301f2a3 commit bd69c8f
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 0 deletions.
9 changes: 9 additions & 0 deletions InstallVERToMap.bat
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,15 @@ if "%~3" == "1" (
if not "%errorlevel%"=="0" SET RESULTMAKEVER=%errorlevel%
MPQEditor a "%~2" "%~dp0Scripts\%VER%\vsai\Blizzard.j" Scripts\Blizzard.j
if not "%errorlevel%"=="0" SET RESULTMAKEVER=%errorlevel%
) else if "%~3" == "3" (
ECHO Installing Tag VS Tag to map
MPQEditor a "%~2" "%~dp0Scripts\%VER%\a\*.txt" Scripts
MPQEditor a "%~2" "%~dp0Scripts\%VER%\a\*.ai" Scripts
MPQEditor a "%~2" "%~dp0Scripts\%VER%\b\*.txt" Scripts
MPQEditor a "%~2" "%~dp0Scripts\%VER%\b\*.ai" Scripts
if not "%errorlevel%"=="0" SET RESULTMAKEVER=%errorlevel%
MPQEditor a "%~2" "%~dp0Scripts\%VER%\vsai\Blizzard.j" Scripts\Blizzard.j
if not "%errorlevel%"=="0" SET RESULTMAKEVER=%errorlevel%
) else (
ECHO Commander not installed
)
Expand Down
39 changes: 39 additions & 0 deletions PitVersions.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
@ECHO OFF
SET VER=%~1
SET TAG=%~2
SET MAP=%~3
@rem git.exe instead of just git, because some git.cmd commands cause the entire batch script to exit.
where git.exe
if "%errorlevel%"=="1" (
ECHO Tagging %VER% error
ECHO Please install Git as a requirement. Download : https://gitforwindows.org/
exit /b 1
)
if "%errorlevel%"=="1" (
ECHO Reference %TAG% not found
exit /b 1
)
if not exist Scripts\%VER%\a\NUL mkdir Scripts\%VER%\a
if not exist Scripts\%VER%\b\NUL mkdir Scripts\%VER%\b
for /f %%a in ('git.exe rev-parse --abbrev-ref HEAD') do set "HEAD_REFNAME=%%a"
for /f %%a in ('git.exe rev-parse HEAD') do set "COMMIT_HASH_A=%%a"
call MakeVERBase.bat %VER% 1
del Scripts\%VER%\a\* /Q
copy Scripts\%VER%\*.ai Scripts\%VER%\a
echo %HEAD_REFNAME%:%COMMIT_HASH_A% > Scripts\%VER%\a\amai_version.txt
echo Tagged HEAD %HEAD_REFNAME% (%COMMIT_HASH_A%) as Version A

git.exe checkout %TAG%
for /f %%a in ('git.exe rev-parse HEAD') do set "COMMIT_HASH_B=%%a"
call MakeVERBase.bat %VER% 1
del Scripts\%VER%\b\* /Q
copy Scripts\%VER%\*.ai Scripts\%VER%\b
ren Scripts\%VER%\b\elf.ai elf2.ai
ren Scripts\%VER%\b\human.ai human2.ai
ren Scripts\%VER%\b\orc.ai orc2.ai
ren Scripts\%VER%\b\undead.ai undead2.ai
echo %TAG%:%COMMIT_HASH_B% > Scripts\%VER%\b\amai_version2.txt
echo Tagged %TAG% (%COMMIT_HASH_B%) as Version B

git.exe checkout %HEAD_REFNAME%
call InstallVERToMap "%VER%" "%MAP%" 3

0 comments on commit bd69c8f

Please sign in to comment.