fix: expand alias in bash
This commit is contained in:
parent
0e488fee97
commit
e6c003bdec
|
@ -1,14 +1,18 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
## dash does not support pipefail
|
# dash does not support pipefail
|
||||||
# this does not work in `dash script.sh`
|
# this does not work in `dash script.sh`
|
||||||
DASH=$(readlink -f "/bin/sh" | grep "dash" || [ $? = 1 ])
|
IS_DASH=$(readlink -f "/bin/sh" | grep "dash" || [ $? = 1 ])
|
||||||
if [ -n "$DASH" ]; then
|
if [ -n "$IS_DASH" ]; then
|
||||||
set -efx
|
set -efx
|
||||||
else
|
else
|
||||||
set -efx -o pipefail
|
set -efx -o pipefail
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# bash does not expand alias by default for non-interactive script
|
||||||
|
if [ -n "$BASH_VERSION" ]; then
|
||||||
|
shopt -s expand_aliases
|
||||||
|
fi
|
||||||
|
|
||||||
## Use GNU grep, busybox grep is not as performant
|
## Use GNU grep, busybox grep is not as performant
|
||||||
DISTRO=""
|
DISTRO=""
|
||||||
|
|
Loading…
Reference in New Issue