Title: RE: Exit Code

Stefan Bodewig [mailto:[EMAIL PROTECTED]] writes:

> > Does anyone know if the future builds of ant will include a valid
> > exit code?
> There already is a bug report to this extent, go and vote for it, or
> even better, send a fix 8-)

Here's one-line fix for NT/2000: add the following line at the end of the ant.bat file - it will exit the script with the exact error status of the last executed external command:

  exit %ERRORLEVEL%

(That works only on NT/2000, by the way - I'm pretty sure this doesn't work in COMMAND.COM).

For all WinXX, the following will at least exit with 0 or 1 status (1 if the error level was anything >= 1):

  if errorlevel 1 exit 1
  exit

--
Shankar.

Reply via email to