we should not `set -e` at the very beginning of this script, which fails
the script if any dependency is missing without printing out error
messages.
in this change `set -e` is removed. and refactor the code to print the
error message.
Signed-off-by: Kefu Chai <kchai@redhat.com>
-#!/bin/sh -e
+#!/bin/sh
cd "$(dirname "$0")"
cd ..
fi
else
for command in virtualenv doxygen ant ditaa cython; do
- command -v "$command" > /dev/null;
- ret_code=$?
- if [ $ret_code -ne 0 ]; then
+ if ! command -v "$command" > /dev/null; then
# add a space after old values
- missing="${missing:+$missing }$command"
- fi
+ missing="${missing:+$missing }$command"
+ fi
done
if [ -n "$missing" ]; then
echo "$0: missing required command, please install them:" 1>&2