framegen: PLAY_FRAMEGEN.cmd check returns the check's answer
The check branch exited 0 whatever the script said, so a caller of "PLAY_FRAMEGEN.cmd check" read success on a failed check (the script exits 1 with the game folder not found). The branch is no longer a block, so errorlevel is the script's own, read where it was set.
This commit is contained in:
@ -12,11 +12,12 @@ if not exist "%PS1%" (
|
||||
pause
|
||||
exit /b 1
|
||||
)
|
||||
if /i "%~1"=="check" (
|
||||
%PSH% -NoProfile -ExecutionPolicy Bypass -File "%PS1%" -Check
|
||||
pause
|
||||
exit /b 0
|
||||
)
|
||||
if /i not "%~1"=="check" goto :menu
|
||||
%PSH% -NoProfile -ExecutionPolicy Bypass -File "%PS1%" -Check
|
||||
pause
|
||||
rem The check's answer is what callers read: a failed check says so.
|
||||
exit /b %errorlevel%
|
||||
:menu
|
||||
set "PICK=%~1"
|
||||
if not "%PICK%"=="" goto :run
|
||||
|
||||
|
||||
Reference in New Issue
Block a user