From c4421d25d9f74b9d7ae896da977ad47dd84311e3 Mon Sep 17 00:00:00 2001 From: MDLeom <2809763-curben@users.noreply.gitlab.com> Date: Sat, 20 May 2023 11:24:04 +0000 Subject: [PATCH] fix: dash does not support pipefail --- src/script.sh | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/script.sh b/src/script.sh index cee30d86..afb10a97 100644 --- a/src/script.sh +++ b/src/script.sh @@ -1,8 +1,13 @@ #!/bin/sh -# works best on busybox ash - -set -efx -o pipefail +## dash does not support pipefail +# this does not work in `dash script.sh` +DASH=$(readlink -f "/bin/sh" | grep "dash" || [ $? = 1 ]) +if [ -n "$DASH" ]; then + set -efx +else + set -efx -o pipefail +fi alias curl="curl -L" alias rm="rm -rf"