1' is the last statement and it does not fail, so
zero is returned! Crazy.
John
At 11:34 AM 3/11/2005, Dick, Brian E. wrote:
[test.bat]
dir test.bat
if not %errorlevel%==0 goto error_exit
:success_exit
exit /b 0
:error_exit
exit /b 1
-Original Mes
Sten, thanks for the added info. It seems putting an 'exit /b' at the end
of ant.bat has the same effect as putting a 'goto: eof' which has the same
effect as leaving ant.bat unmodified (sort of like putting a return
statement at the end of a C/C++ function that returns void). Again, no
surpris
Indeed. The 'exit' fixes the return-code problem when launching the bat
file from a perl script, but clearly, the 'exit' introduces a much bigger
problem if you're just executing bat files sans perl. Definitely not
something that should be added to run.bat in production! Thanks for the
correcti
I had tried that, too, but that opens up a different can of worms. The perl
script I'm writing can't assume that .pl is registered as an executable
extension (such that one can simply type, for example, runant.pl, at a
command line and the file will automatically by fed to perl.exe). So I
can't
Hi,
I'm having a tough time figuring out how to get the return code from an Ant
invocation when using perl. The problem is that the Ant front end is a .bat
file (I'm working on Windows). When you invoke a bat file from perl, and
that bat file in turn invokes something else (the Java Ant applica