manage multi-install improve exit code

pull/129/head
Botspot 5 years ago
parent c3a08ec8ae
commit 9f6eec1f14

@ -34,6 +34,7 @@ dirhash() {
echo "$hash" 1>&2 echo "$hash" 1>&2
} }
if [ "$1" == 'multi-install' ];then if [ "$1" == 'multi-install' ];then
failed=0
PREIFS="$IFS" PREIFS="$IFS"
IFS=$'\n' IFS=$'\n'
for app in $2 for app in $2
@ -44,10 +45,11 @@ if [ "$1" == 'multi-install' ];then
fi fi
done done
IFS="$PREIFS" IFS="$PREIFS"
if [ $failed == 1 ] && [ "$(echo "$1" | wc -l)" == 1 ];then if [ $failed == 1 ];then
exit 1 exit 1
fi fi
elif [ "$1" == 'multi-uninstall' ];then elif [ "$1" == 'multi-uninstall' ];then
failed=0
PREIFS="$IFS" PREIFS="$IFS"
IFS=$'\n' IFS=$'\n'
for app in $2 for app in $2
@ -58,7 +60,7 @@ elif [ "$1" == 'multi-uninstall' ];then
fi fi
done done
IFS="$PREIFS" IFS="$PREIFS"
if [ $failed == 1 ] && [ "$(echo "$1" | wc -l)" == 1 ];then if [ $failed == 1 ];then
exit 1 exit 1
fi fi
elif [ "$1" == 'install' ];then elif [ "$1" == 'install' ];then

Loading…
Cancel
Save