fix set -e
This commit is contained in:
13
download.sh
13
download.sh
@ -319,8 +319,17 @@ done
|
|||||||
# Enforce mutual exclusivity between -c, -p, -f
|
# Enforce mutual exclusivity between -c, -p, -f
|
||||||
set -- "$collection" "$post" "$file"
|
set -- "$collection" "$post" "$file"
|
||||||
count=0
|
count=0
|
||||||
for x in "$@"; do [[ -n $x ]] && ((count++)); done
|
for x in "$@"; do
|
||||||
(( count == 1 )) || { usage; die "Options -c, -p och -f kan inte användas samtidigt (exakt en krävs)."; }
|
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
|
lock
|
||||||
log "NOOP=$NOOP DEBUG=$DEBUG OUTDIR=$OUTDIR"
|
log "NOOP=$NOOP DEBUG=$DEBUG OUTDIR=$OUTDIR"
|
||||||
|
|||||||
Reference in New Issue
Block a user