With batch files, I'm trying to run commands, if the command returns an error try other commands with GOTO for each one...however the script keeps failing with an error....but it shouldn't right now at least if the last GOTO doesn't work it should just go into an endless loop.
I've read that checking if there is an error is this...
IF %ERRORLEVEL% NEQ 0 (
GOTO tryInRoot
)
But I'm not quite sure, any help?
grunt precommit
IF %ERRORLEVEL% NEQ 0 (
GOTO tryInRoot
)
:tryInRoot
cd mow\client && grunt precommit
IF %ERRORLEVEL% NEQ 0 (
GOTO tryInTrunk
)
:tryInTrunk
cd client && grunt precommit
IF %ERRORLEVEL% NEQ 0 (
GOTO whenInMapManager
)
:whenInMapManager
cd ..
IF EXIST "Gruntfile.js" (
GOTO leavingMapManager
) ELSE (
GOTO whenInMapManager
)
:leavingMapManager
cd ..
cd mow\client && grunt precommit