commit 99ca39b38bf7cc12e637ea5017ff484aca5e5120 parent eb94a3f5b5aaa62c6b4de0a0d0cc7f00419fc63f Author: Marcello Stanisci <stanisci.m@gmail.com> Date: Thu, 23 May 2019 16:23:20 +0200 make (source'd) script resilient to "set -e" Diffstat:
| M | taler-build/cat_failed.sh | | | 33 | +++++++++++++++------------------ |
1 file changed, 15 insertions(+), 18 deletions(-)
diff --git a/taler-build/cat_failed.sh b/taler-build/cat_failed.sh @@ -2,24 +2,21 @@ cat_failed () { - if ! test -d "$1"; then - echo ERROR dumping the failing test logs. - echo - echo Give valid directory to start crawling. - echo Example ./cat_failed.sh dir/ - echo - return 1 - fi + if ! test -d "$1"; then + echo ERROR dumping the failing test logs. + echo + echo Give valid directory to start crawling. + echo Example ./cat_failed.sh dir/ + echo + return 1 + fi - for trs in $(find "$1" -name *.trs) ; do - - head -q -n1 < $trs | grep -q FAIL - - if test $? = 0; then - filename_log=$(echo ${trs}|sed -e 's/trs$/log/') - cat ${filename_log} - fi - - done + for trs in $(find "${1}" -name "*.trs") ; do + if head -q -n1 < ${trs} | grep -q FAIL; then + filename_log=$(echo ${trs}|sed -e 's/trs$/log/') + cat ${filename_log} + fi + done + return 0 }