From 8e6fe7d945f1effaf6b87f8b5ed18b425a93508c Mon Sep 17 00:00:00 2001 From: dakkar Date: Wed, 19 Aug 2009 13:49:58 +0200 Subject: better error handling --- doit.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/doit.sh b/doit.sh index e03fb45..1e2fbe6 100755 --- a/doit.sh +++ b/doit.sh @@ -6,13 +6,14 @@ else command="perl -I/home/dakkar/src/WebCoso/lib/ /home/dakkar/src/WebCoso/script/webcoso.pl" fi -$command -s src/ -d output -I templates/ "$@" +if ! $command -s src/ -d output -I templates/ "$@"; then + echo "Something wrong: $!" >&2 + exit 1 +fi -if [[ $! -eq 0 && -z "$*" ]]; then +if [[ "$*" != '--clean' ]]; then rsync -r output/ /var/www/localhost/htdocs/ rsync -r additions/ /var/www/localhost/htdocs/ -else - echo "Something wrong: $!" >&2 fi -- cgit v1.2.3