When there's nothing to do, exit without trying to build the script.

This commit is contained in:
Andrea Dell'Amico 2017-07-26 17:17:06 +02:00
parent 27f3a4f000
commit 925d545be2
1 changed files with 13 additions and 8 deletions

View File

@ -22,6 +22,7 @@ trap "logger 'algorithms-updater: trap intercepted, exiting.' ; cleanup 1" SIGHU
function cleanup() {
rm -fr $OUT_DIR
rm -f $LOCK_FILE
logger 'algorithms-updater: Exiting'
exit $1
}
@ -103,6 +104,7 @@ function algorithms_updater() {
done < ${ALGORITHMS_TEMP_SCRIPT}.algorithmslist
set -o pipefail
set -e
if [ -f $ALGORITHMS_TEMP_SCRIPT.body_ ] ; then
mv $ALGORITHMS_TEMP_SCRIPT.body_ $ALGORITHMS_TEMP_SCRIPT.body
cat $ALGORITHMS_TEMP_SCRIPT.head $ALGORITHMS_TEMP_SCRIPT.body > $ALGORITHMS_TEMP_SCRIPT
chmod 755 $ALGORITHMS_TEMP_SCRIPT
@ -113,6 +115,9 @@ function algorithms_updater() {
logger 'algorithms-updater: {{ smartgears_user_home }}/algorithmInstaller/addAlgorithm.sh is not an executable, aborting'
cleanup 1
fi
else
cleanup 0
fi
}
#