- Jun
- 137
- 3
I have a couple of aliases I had defined:
(update is a form of the copy command, and MaybeQuote is a function that puts quotes around a string if there are spaces in it)
When I called ScriptUpdate, it stopped executing after the first 'if' statement. After digging a while and liberally injecting 'echo' statements, I figured out that it was the 'if' that causes problems. If I changed them to 'iff'/'endiff' pairs, all worked fine. Is this a known bug?
Modifying the two above to this form, they now work properly:
ScriptUpdate=iff isdir "Script Files" then %+ pushd "Script Files" %+ else %+ pushd %+ endiff %+ if isfile Setup.ino del /qk Setup.ino;Setup.obs %+ cd .. %+ if %@index[%$,/y] GE 0 set _YN=y %+ if %@index[%$,/n] GE 0 set _YN=n %+ if (%_YN) = () inkey Update debug files? %%_YN %+ for /h /a:d %a in (Media\*) for /h /a:d %b in (%@MaybeQuote[%a\*]) for /h /a:d %c in (%@MaybeQuote[%b\*]) SetupInsUpdate %c%+ popd %+ unset /q _YN
SetupInsUpdate=if isfile %@MaybeQuote[%$\Setup.exe] (echo. %+ update /p "Script Files\Setup.ins" %@MaybeQuote[%$\Setup.ins] %+ echo. %+ iff %@MaybeQuote[%$] %+ else %+ if isfile %@MaybeQuote[%$\Setup.dbg;*.rul;*.h] del /k %@MaybeQuote[%$\Setup.dbg;*.rul;*.h] %+ endiff)
SetupInsUpdate=if isfile %@MaybeQuote[%$\Setup.exe] (echo. %+ update /p "Script Files\Setup.ins" %@MaybeQuote[%$\Setup.ins] %+ echo. %+ iff %@MaybeQuote[%$] %+ else %+ if isfile %@MaybeQuote[%$\Setup.dbg;*.rul;*.h] del /k %@MaybeQuote[%$\Setup.dbg;*.rul;*.h] %+ endiff)
(update is a form of the copy command, and MaybeQuote is a function that puts quotes around a string if there are spaces in it)
When I called ScriptUpdate, it stopped executing after the first 'if' statement. After digging a while and liberally injecting 'echo' statements, I figured out that it was the 'if' that causes problems. If I changed them to 'iff'/'endiff' pairs, all worked fine. Is this a known bug?
Modifying the two above to this form, they now work properly:
ScriptUpdate=iff isdir "Script Files" then %+ pushd "Script Files" %+ else %+ pushd %+ endiff %+ del /qk Setup.ino;Setup.obs %+ cd .. %+ iff %@index[%$,/y] GE 0 then %+ set _YN=y %+ endiff %+ iff %@index[%$,/n] GE 0 then %+ set _YN=n%+ endiff %+ iff (%_YN) = () then %+ inkey Update debug files? %%_YN %+ endiff %+ for /h /a:d %a in (Media\*) for /h /a:d %b in (%@MaybeQuote[%a\*]) for /h /a:d %c in (%@MaybeQuote[%b\*]) SetupInsUpdate %c %+ popd %+ unset /q _YN
SetupInsUpdate=if isfile %@MaybeQuote[%$\Setup.exe] (echo. %+ update /p "Script Files\Setup.ins" %@MaybeQuote[%$\Setup.ins] %+ echo. %+ iff %@MaybeQuote[%$] %+ else %+ if isfile %@MaybeQuote[%$\Setup.dbg;*.rul;*.h] del /k %@MaybeQuote[%$\Setup.dbg;*.rul;*.h] %+ endiff)
SetupInsUpdate=if isfile %@MaybeQuote[%$\Setup.exe] (echo. %+ update /p "Script Files\Setup.ins" %@MaybeQuote[%$\Setup.ins] %+ echo. %+ iff %@MaybeQuote[%$] %+ else %+ if isfile %@MaybeQuote[%$\Setup.dbg;*.rul;*.h] del /k %@MaybeQuote[%$\Setup.dbg;*.rul;*.h] %+ endiff)