From a83a057383151ddc5bfd9eea4c45af5de8e68bd3 Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Mon, 2 Mar 2020 17:52:04 -0600 Subject: Move "scripts/cross.sh all" log files into root/log. --- scripts/cross.sh | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/cross.sh b/scripts/cross.sh index 2570713d..bdf03ed9 100755 --- a/scripts/cross.sh +++ b/scripts/cross.sh @@ -25,6 +25,9 @@ list() } [ $# -eq 0 ] && list && exit +[ -z "$TOP" ] && TOP="$PWD/root/log" +mkdir -p "$TOP" || exit 1 + X="$1" shift @@ -33,11 +36,18 @@ if [ "$X" == all ] then for TARGET in $(list) do + LOG="$TOP/cross-log-$TARGET" { export TARGET echo -en "\033]2;$TARGET $*\007" - "$0" $TARGET "$@" 2>&1 || mv cross-log-$TARGET.{txt,failed} - } | tee cross-log-$TARGET.txt + + rm -f "$LOG".{failed,success} + "$0" $TARGET "$@" 2>&1 + X=$? + [ $X -eq 0 -o $X -eq 42 ] && mv "$LOG".{txt,success} + } |& tee "$LOG".txt + [ -z "$ALL" ] && [ ! -e "$LOG".success ] && + { mv "$LOG".{txt,failed} ; break;} done exit -- cgit v1.2.3