1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

tweak hacking/env-setup to work under ash (#17054)

This commit is contained in:
Matt Davis 2016-08-11 16:58:08 -07:00 committed by GitHub
parent 39d764c7ad
commit 525c0469d2

View file

@ -16,9 +16,9 @@ if [ -n "$BASH_SOURCE" ] ; then
HACKING_DIR=$(dirname "$BASH_SOURCE") HACKING_DIR=$(dirname "$BASH_SOURCE")
elif [ $(basename -- "$0") = "env-setup" ]; then elif [ $(basename -- "$0") = "env-setup" ]; then
HACKING_DIR=$(dirname "$0") HACKING_DIR=$(dirname "$0")
# Works with ksh93 but not pdksh # Works with ksh93 but not pdksh, have to eval to keep ash happy...
elif [ -n "$KSH_VERSION" ] && echo $KSH_VERSION | grep -qv '^@(#)PD KSH'; then elif [ -n "$KSH_VERSION" ] && echo $KSH_VERSION | grep -qv '^@(#)PD KSH'; then
HACKING_DIR=$(dirname "${.sh.file}") eval "HACKING_DIR=\$(dirname \"\${.sh.file}\")"
else else
HACKING_DIR="$PWD/hacking" HACKING_DIR="$PWD/hacking"
fi fi