rathena/tools/ci/npc.bat
Lemongrass3110 b3cfd12228 Added the custom and test scripts to the buildbot (#2658)
* Added the custom and test scripts to the buildbot

All scripts inside the custom and test npc directory are now parsed and executed automatically by the buildbot.
The only exceptions are the custom battleground scripts that would cause duplication warnings.

Thanks to @Jeybla for the Unix script!
2017-12-01 12:50:34 -05:00

53 lines
992 B
Batchfile

@echo off
setlocal enabledelayedexpansion
rem switch to the npc folder
cd ..\..\npc\
rem store the output destination
set OUT=%CD%\scripts_custom.conf
rem switch to the custom folder
cd custom\
rem newline
echo. >> !OUT!
rem header
echo // Custom Scripts >> !OUT!
rem store the current directory
set C=%CD%
rem make sure that no paranthesis close is unescaped inside the path
set C=!C:^)=^^^)!
for /R . %%f in (*.txt) do (
rem store it to allow delayed expansion
set B=%%f
rem store relative path for compare
set R=!B:%C%\=!
rem all except the battleground scripts
if "!R:~0,12!" neq "battleground" (
echo npc: npc\custom\!R!>>!OUT!
)
)
rem switch to the test folder
cd ..\test
rem header
echo // Test scripts >> !OUT!
rem store the current directory
set C=%CD%
rem make sure that no paranthesis close is unescaped inside the path
set C=!C:^)=^^^)!
for /R . %%f in (*.txt) do (
rem store it to allow delayed expansion
set B=%%f
echo npc: npc\test\!B:%C%\=!>>!OUT!
)