summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid P <megver83@parabola.nu>2018-05-29 15:08:03 -0400
committerDavid P <megver83@parabola.nu>2018-05-29 15:10:34 -0400
commitf19eea038b82f474de147c561f16292c8e244300 (patch)
tree1e178a7ccfad0019a466ca76b4362be22fb11004
parent15ce7bf729e39b8589fa403a896fd5bc074918c4 (diff)
run.sh: change way to manage errors
Signed-off-by: David P <megver83@parabola.nu>
-rwxr-xr-xrun.sh13
1 files changed, 6 insertions, 7 deletions
diff --git a/run.sh b/run.sh
index c2007c2..99d1f7f 100755
--- a/run.sh
+++ b/run.sh
@@ -94,17 +94,16 @@ main(){
for i in $@; do
load "Modifying $i" &
LOG=$(mktemp)
- deblob $i &> $LOG
- case $? in
- 0) printf "[ OK ] \n" ;;
- *) printf "[ FAILED ] \n"
- err "Could not modify $i:"
- cat $LOG; false ;;
- esac
+ deblob $i &> $LOG && \
+ printf "[ OK ] \n" || \
+ (printf "[ FAILED ] \n"
+ err "Could not modify $i") || \
+ cat $LOG && fail=x
kill $!
wait $! 2>/dev/null || true
rm $LOG
done
+ if [[ $fail = x ]]; then false; fi
}
if [[ $# -lt 1 ]]; then