fix set -e

This commit is contained in:
Urban Modig
2025-10-01 11:20:42 +02:00
parent ff12de43a9
commit 19aca51706

View File

@ -319,8 +319,17 @@ done
# Enforce mutual exclusivity between -c, -p, -f
set -- "$collection" "$post" "$file"
count=0
for x in "$@"; do [[ -n $x ]] && ((count++)); done
(( count == 1 )) || { usage; die "Options -c, -p och -f kan inte användas samtidigt (exakt en krävs)."; }
for x in "$@"; do
if [[ -n $x ]]; then
((count++))
fi
done
# Ensure a zero exit status here to avoid set -e exiting if the last test was false
true
if (( count != 1 )); then
usage
die "Options -c, -p och -f kan inte användas samtidigt (exakt en krävs)."
fi
lock
log "NOOP=$NOOP DEBUG=$DEBUG OUTDIR=$OUTDIR"