-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add comment support for the options file
also changes its extension to .yaml
- Loading branch information
Showing
3 changed files
with
46 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,34 @@ | ||
@echo off | ||
setlocal EnableDelayedExpansion | ||
set "args=" | ||
if not exist options.txt ( | ||
echo includeExtraFiles=ask> OPTIONS.txt | ||
echo rebuildMod=ask>> options.txt | ||
echo combine=ask>> options.txt | ||
echo copy=ask>> options.txt | ||
echo updateMBINCompiler=ask>> options.txt | ||
echo checkForConflicts=ask>> options.txt | ||
echo recreatePakList=ask>> options.txt | ||
echo|set /p="recreateMapFileTrees=ask">> options.txt | ||
set "rootPath=%~dp0" | ||
set "optionsFile=!rootPath!\OPTIONS.yaml" | ||
|
||
if not exist %optionsFile% ( | ||
echo # These are the default options used by BuildMod.bat to build your mods.>%optionsFile% | ||
echo # In each one of them you can either specify a default value or put 'ask'.>> %optionsFile% | ||
echo # Any option with a value of ask will result in the builder to ask you the question during the build process.>> %optionsFile% | ||
echo.>>%optionsFile% | ||
echo # Possible Values:>> %optionsFile% | ||
echo # combine = ask, none, simple, composite, numericSuffix>> %optionsFile% | ||
echo # copy = ask, none, all, some>> %optionsFile% | ||
echo.>>%optionsFile% | ||
echo # All the other options are flags with possible values of: ask, true, false>> %optionsFile% | ||
echo.>>%optionsFile% | ||
echo combine: ask>> %optionsFile% | ||
echo copy: ask>> %optionsFile% | ||
echo includeExtraFiles: ask>> %optionsFile% | ||
echo rebuildMod: ask>> %optionsFile% | ||
echo updateMBINCompiler: ask>> %optionsFile% | ||
echo checkForConflicts: ask>> %optionsFile% | ||
echo recreatePakList: ask>> %optionsFile% | ||
echo|set /p="recreateMapFileTrees: ask">> %optionsFile% | ||
) | ||
for /f "tokens=1,2 delims==" %%G in (options.txt) do ( | ||
|
||
rem The added space character in `delims=: ` is to support same line comments in the yaml file. | ||
rem As a side effect typing `key value` instead of `key: value` would also work. | ||
rem If we decide to just not support same line comments we should change it to `delims=:` | ||
for /f "tokens=1,2 eol=# delims=: " %%G in (%optionsFile%) do ( | ||
set "args=!args!-%%G %%~H " | ||
) | ||
Builder.bat %args% | ||
!rootPath!\Builder.bat %args% |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# These are the default options used by BuildMod.bat to build your mods. | ||
# In each one of them you can either specify a default value or put 'ask'. | ||
# Any option with a value of ask will result in the builder to ask you the question during the build process. | ||
|
||
# Possible Values: | ||
# combine = ask, none, simple, composite, numericSuffix | ||
# copy = ask, none, all, some | ||
|
||
# All the other options are flags with possible values of: ask, true, false | ||
|
||
combine: ask | ||
copy: ask | ||
includeExtraFiles: ask | ||
rebuildMod: ask | ||
updateMBINCompiler: ask | ||
checkForConflicts: ask | ||
recreatePakList: ask | ||
recreateMapFileTrees: ask |
e2129be
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great. Just what I was looking for. And I see your English is surely as good as mine (French-Canadian here)