mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Add KSH compat
cherry picked from https://github.com/ansible/ansible/pull/6899
This commit is contained in:
parent
75d3c6b104
commit
7c86db3187
2 changed files with 5 additions and 1 deletions
|
@ -16,6 +16,8 @@ if [ -n "$BASH_SOURCE" ] ; then
|
|||
HACKING_DIR=$(dirname "$BASH_SOURCE")
|
||||
elif [ $(basename -- "$0") = "env-setup" ]; then
|
||||
HACKING_DIR=$(dirname "$0")
|
||||
elif [ -n "$KSH_VERSION" ]; then
|
||||
HACKING_DIR=$(dirname "${.sh.file}")
|
||||
else
|
||||
HACKING_DIR="$PWD/hacking"
|
||||
fi
|
||||
|
|
|
@ -14,8 +14,10 @@ fi
|
|||
# When run using source as directed, $0 gets set to bash, so we must use $BASH_SOURCE
|
||||
if [ -n "$BASH_SOURCE" ] ; then
|
||||
HACKING_DIR=$(dirname "$BASH_SOURCE")
|
||||
elif [ $(basename "$0") = "env-setup" ]; then
|
||||
elif [ $(basename -- "$0") = "env-setup" ]; then
|
||||
HACKING_DIR=$(dirname "$0")
|
||||
elif [ -n "$KSH_VERSION" ]; then
|
||||
HACKING_DIR=$(dirname "${.sh.file}")
|
||||
else
|
||||
HACKING_DIR="$PWD/hacking"
|
||||
fi
|
||||
|
|
Loading…
Reference in a new issue