Source

broguex / update.bat

Full commit
REM Do not print each command as it is executed.

@ECHO off

REM This should only be executed from the directory it is located in.
REM
REM 1. Clone or update the external source code repositories.
REM 2. Update them to the correct branch.
REM 3. Verify that any additional user provided files are present.
REM 4. Continually prompt the user until user has provided said files.
REM

SET LIBTCOD_DIR=libtcod
SET SDL2_DIR=sdl2
SET BROGUE_DIR=brogue

SET LIBTCOD_PATH=D:\VCS\HG\libraries\libtcod
SET SDL2_PATH=D:\VCS\HG\libraries\SDL
SET BROGUE_PATH=D:\VCS\HG\games\brogue

PUSHD .
CD jni

:LIBTCOD
IF EXIST %LIBTCOD_DIR% GOTO UPDATE_LIBTCOD
HG clone %LIBTCOD_PATH% %LIBTCOD_DIR%
HG up
GOTO SDL2
:UPDATE_LIBTCOD
PUSHD .
CD %LIBTCOD_DIR%
HG pull -u
POPD

:SDL2
IF EXIST %SDL2_DIR% GOTO UPDATE_SDL2
HG clone %SDL2_PATH% %SDL2_DIR%
HG up unofficial-SDL2
GOTO BROGUE
:UPDATE_SDL2
PUSHD .
CD %SDL2_DIR%
HG pull -u
POPD

:BROGUE
IF EXIST %BROGUE_DIR% GOTO UPDATE_BROGUE
HG clone %BROGUE_PATH% %BROGUE_DIR%
HG up
GOTO HG_END
:UPDATE_BROGUE
PUSHD .
CD %BROGUE_DIR%
HG pull -u
POPD

:HG_END
POPD

:ASSET_CHECK
IF NOT EXIST assets GOTO MISSING_ASSETS
IF NOT EXIST assets\fonts\font-1.png GOTO MISSING_ASSETS

GOTO BAT_END
:MISSING_ASSETS
SET /P discard=Can you create an 'assets' folder with the Brogue fonts and icon?
GOTO ASSET_CHECK

:BAT_END