From 2598f40a611e61191cef6e9e81de8906458dd893 Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Mon, 2 Mar 2020 18:47:57 -0600 Subject: More cross.sh tweaks. --- scripts/cross.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/scripts/cross.sh b/scripts/cross.sh index bdf03ed9..bee836ec 100755 --- a/scripts/cross.sh +++ b/scripts/cross.sh @@ -8,6 +8,8 @@ # With no arguments, lists available targets. Use target "all" to iterate # through each $TARGET from the list. +trap "exit 1" INT + CCC="$(dirname "$(readlink -f "$0")")"/../ccc if [ ! -d "$CCC" ] then @@ -21,7 +23,7 @@ unset X Y # Display target list? list() { - ls "$CCC" | sed 's/-.*//' | sort -u | xargs + ls "$CCC" | sed -n 's/-.*//p' | sort -u | xargs } [ $# -eq 0 ] && list && exit @@ -44,10 +46,9 @@ then rm -f "$LOG".{failed,success} "$0" $TARGET "$@" 2>&1 X=$? - [ $X -eq 0 -o $X -eq 42 ] && mv "$LOG".{txt,success} + [ $X -eq 0 ] && mv "$LOG".{txt,success} } |& tee "$LOG".txt - [ -z "$ALL" ] && [ ! -e "$LOG".success ] && - { mv "$LOG".{txt,failed} ; break;} + [ ! -e "$LOG".success ] && { mv "$LOG".{txt,failed};[ -z "$ALL" ] && break;} done exit -- cgit v1.2.3