Print only the failed log
authorKhaled Hosny <khaledhosny@eglug.org>
Thu, 15 Feb 2018 09:47:08 +0000 (11:47 +0200)
committerKhaled Hosny <khaledhosny@eglug.org>
Fri, 16 Feb 2018 20:01:33 +0000 (22:01 +0200)
.ci/fail.sh

index 5f4b641..c468710 100755 (executable)
@@ -1,8 +1,10 @@
 #!/bin/bash
 
 for f in $(find . -name '*.log' -not -name 'config.log'); do
-    echo '====' $f '===='
-    cat $f
+    if [[ $(tail -1 $f) = FAIL* ]]; then
+        echo '====' $f '===='
+        cat $f
+    fi
 done
 
 # Intentionally exiting with non-zero.