1
1
@ echo off
2
2
setlocal EnableDelayedExpansion
3
3
set " args = "
4
- if not exist options.txt (
5
- echo includeExtraFiles=ask> OPTIONS.txt
6
- echo rebuildMod=ask>> options.txt
7
- echo combine=ask>> options.txt
8
- echo copy=ask>> options.txt
9
- echo updateMBINCompiler=ask>> options.txt
10
- echo checkForConflicts=ask>> options.txt
11
- echo recreatePakList=ask>> options.txt
12
- echo| set /p=" recreateMapFileTrees=ask" >> options.txt
4
+ set " rootPath = %~dp0 "
5
+ set " optionsFile = !rootPath! \OPTIONS.yaml"
6
+
7
+ if not exist %optionsFile% (
8
+ echo # These are the default options used by BuildMod.bat to build your mods.> %optionsFile%
9
+ echo # In each one of them you can either specify a default value or put 'ask'.>> %optionsFile%
10
+ echo # Any option with a value of ask will result in the builder to ask you the question during the build process.>> %optionsFile%
11
+ echo .>> %optionsFile%
12
+ echo # Possible Values:>> %optionsFile%
13
+ echo # combine = ask, none, simple, composite, numericSuffix>> %optionsFile%
14
+ echo # copy = ask, none, all, some>> %optionsFile%
15
+ echo .>> %optionsFile%
16
+ echo # All the other options are flags with possible values of: ask, true, false>> %optionsFile%
17
+ echo .>> %optionsFile%
18
+ echo combine: ask>> %optionsFile%
19
+ echo copy: ask>> %optionsFile%
20
+ echo includeExtraFiles: ask>> %optionsFile%
21
+ echo rebuildMod: ask>> %optionsFile%
22
+ echo updateMBINCompiler: ask>> %optionsFile%
23
+ echo checkForConflicts: ask>> %optionsFile%
24
+ echo recreatePakList: ask>> %optionsFile%
25
+ echo| set /p=" recreateMapFileTrees: ask" >> %optionsFile%
13
26
)
14
- for /f " tokens=1,2 delims==" %%G in (options.txt) do (
27
+
28
+ rem The added space character in `delims=: ` is to support same line comments in the yaml file.
29
+ rem As a side effect typing `key value` instead of `key: value` would also work.
30
+ rem If we decide to just not support same line comments we should change it to `delims=:`
31
+ for /f " tokens=1,2 eol=# delims=: " %%G in (%optionsFile% ) do (
15
32
set " args = !args! -%%G %%~H "
16
33
)
17
- Builder.bat %args%
34
+ !rootPath! \ Builder.bat %args%
0 commit comments