summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristophe Lyon <christophe.lyon@linaro.org>2017-02-17 19:50:22 +0000
committerChristophe Lyon <christophe.lyon@linaro.org>2017-02-17 19:50:22 +0000
commita037c0b8f2271f1a4addb9e2384f74336fcb4dc3 (patch)
treef47e53752982492b5ee0d3fb48d7d32269a0a9d2
parentf2727d7cdec553da2e9381db75c8b37683b3f0e9 (diff)
jenkins.sh: Exit early when an error is detected.
Instead of just printing an help message and continuing. Change-Id: I6734639095589c861e72d8c0f4a444b86fefa1fc
-rwxr-xr-xjenkins.sh8
1 files changed, 5 insertions, 3 deletions
diff --git a/jenkins.sh b/jenkins.sh
index 6f480785..ac4d5a62 100755
--- a/jenkins.sh
+++ b/jenkins.sh
@@ -24,16 +24,17 @@ PS4='+ $PRGNAME: ${FUNCNAME+"$FUNCNAME : "}$LINENO: '
usage()
{
+ ret=1
+ [ x"$1" != x ] && ret=$1
cat << EOF
jenkins.sh [--help] [-s snapshot dir] [g git reference dir] [--abedir path] [-w workspace]
EOF
- return 0
+ exit $ret
}
if test $# -lt 1; then
echo "ERROR: No options for build!"
usage
-# exit
fi
# Directory of ABE source files
@@ -113,7 +114,8 @@ while test $# -gt 0; do
-b|--bootstrap) try_bootstrap="true" ;;
--excludecheck) excludecheck_opt="$excludecheck_opt --excludecheck $2"; shift ;;
--norebuild) rebuild=false ;;
- -h|--help) usage ;;
+ -h|--help) usage 0 ;;
+ *) usage ;;
esac
shift
done