forrest-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Eirik Bjørsnøs <bjors...@stud.ntnu.no>
Subject Return value from Forrest shell script
Date Tue, 29 Jul 2003 09:14:33 GMT

Hello all,


We're using a shell script to generate our forrest sites from CVS.

I would like to send an email or something when "forrest site" fails
because of invalid XML or other problems.

In order to do this I need access to the return value of the ant process.

I've noticed that the $FORREST_HOME/bin/forrest script always returns 0,
even if site generation failed.

The return status of a shell is always the return status of the last
command executed in the shell.

The last command in bin/forrest is "export ANT_HOME", which always returns
success, I would guess.

To fix this, I added the following line right after the execution of ant
in bin/forrest:

FORREST_RETVAL=$?

and then, on the very last line of the script:
exit $FORREST_RETVAL

I'm not a shell script wizard, but I've tested it, and it works.

You might consider adding it to CVS, if it does not break anything else.


Eirik.
-- 
Eirik Bjørsnøs
bjorsnos@stud.ntnu.no

Mime
View raw message