Russell Hind wrote:
> I'll have a look tonight, but I've no idea. I have a bat file that
> calls the build.bat of TSVN. If someone knows how to right a .bat
> script that can check a return value from build.bat then possibly but
> otherwise I doubt it.
If you're running (IIRC) NT4+, you can check %ERRORLEVEL%, otherwise (as
others noted) "if errorlevel 1" works.. But this is easily clobbered by
any successful command between when the failure happened and build.bat
returns. We use a system like below (I just typed it, so there may be
typos):
mybuild.cmd:
set TRY=call try.cmd
set MASTERERRORLOG=logs\master.log
set GLOBAL_ERROR_FLAG=
%TRY% run_important_command.exe
%TRY% call another_batchfile.bat
some_command_we_don't_really_care_about.cmd
%TRY% copy important\files\* dest\
if defined GLOBAL_ERROR_FLAG (
die horrible death, do not post build, do not collect $200.
)
try.cmd:
%*
:: add any custom errorlevels you want here
:: remember "if errorlevel 1" means >= 1, not == 1
if errorlevel 1 set returncode=1&goto checkerror
if errorlevel 0 set returncode=0&goto checkerror
:checkerror
if "%returncode%"=="0" goto :eof
set MSG=Error !!! Command returned [%returncode%]: %1 %2 %3 %4 %5
echo %MSG%
echo %MSG%>> %MASTERERRORLOG%
set GLOBAL_ERROR_FLAG=true
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tortoisesvn.tigris.org
For additional commands, e-mail: dev-help@tortoisesvn.tigris.org
Received on Tue Nov 23 17:54:47 2004