summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDanny Baumann <dannybaumann@web.de>2007-05-08 08:13:32 +0200
committerDanny Baumann <dannybaumann@web.de>2007-05-08 08:13:32 +0200
commitedca4ee3bb49feab278bf3190b4465458f536ccf (patch)
treeffb983377e3b817e17e091543804c918530eb27f /src
parente662a72172abea2d9cfb8dd321efa434a121e82e (diff)
downloadbcop-edca4ee3bb49feab278bf3190b4465458f536ccf.tar.gz
bcop-edca4ee3bb49feab278bf3190b4465458f536ccf.tar.bz2
Better (more generic) error handling.
Diffstat (limited to 'src')
-rwxr-xr-xsrc/bcop.in13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/bcop.in b/src/bcop.in
index 94356c7..5b1fb8c 100755
--- a/src/bcop.in
+++ b/src/bcop.in
@@ -53,18 +53,21 @@ do
shift
done
-if [ ! -e $xsltdir/bcop.xslt ]; then
- echo -n "The needed stylesheet $xsltdir/bcop.xslt was not found. Aborting..."
- exit 1
-fi
-
xmlfile="$1"
if [ -e $xmlfile ]; then
if [ -n "$hdrfile" ]; then
xsltproc --stringparam "header" "true" $xsltdir/bcop.xslt $xmlfile > "$hdrfile"
+ RETVAL=$?
+ if [ $RETVAL -ne 0 ]; then
+ exit $RETVAL
+ fi
fi
if [ -n "$srcfile" ]; then
xsltproc --stringparam "source" "true" $xsltdir/bcop.xslt $xmlfile > "$srcfile"
+ RETVAL=$?
+ if [ $RETVAL -ne 0 ]; then
+ exit $RETVAL
+ fi
fi
fi