detect if `set -o pipefail` is available
@@ -53,7 +53,10 @@ check_program_in_path $CLI
check_program_in_path $NODE
# exit on failure inside pipes (might be unavailable on some shells)
-set -o pipefail || true
+set -o | grep 'pipefail' > /dev/null
+if [ $? -eq 0 ]; then
+ set -o pipefail
+fi
# exit on failure
set -e
