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 Re: Return value from Forrest shell script
Date Tue, 29 Jul 2003 10:17:19 GMT
On Tue, 29 Jul 2003, Juan Jose Pablos wrote:

> Eirick,
>
> I think that this have been fixed a month ago. Are you using the latest
>   version?
>
> Cheers,
> Cheche


Woops.. I have both 0.4 and CVS version installed, I must have checked
agaist the wrong one.

Thanks anyway, I'll do better research next time :-)

Eirik.


> Eirik Bjørsnøs wrote:
> > 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