Merge pull request #9 from ahmetb/readlink

Fallback to readlink -f on macOS
This commit is contained in:
Ahmet Alp Balkan 2017-05-17 10:07:04 -07:00 committed by GitHub
commit 9a7358ce67
2 changed files with 6 additions and 2 deletions

View File

@ -21,7 +21,9 @@
set -eou pipefail
IFS=$'\n\t'
SCRIPT_DIR="$(dirname "$(readlink -f "$0")")"
SCRIPT_DIR="$(dirname "$( readlink -f "${0}" 2>/dev/null || \
python -c "import os,sys; print(os.path.realpath(sys.argv[1]))" "${0}" )")"
if [[ -f "${SCRIPT_DIR}/utils.bash" ]]; then
source "${SCRIPT_DIR}/utils.bash"
else

4
kubens
View File

@ -21,7 +21,9 @@
set -eou pipefail
IFS=$'\n\t'
SCRIPT_DIR="$(dirname "$(readlink -f "$0")")"
SCRIPT_DIR="$(dirname "$( readlink -f "${0}" 2>/dev/null || \
python -c "import os,sys; print(os.path.realpath(sys.argv[1]))" "${0}" )")"
if [[ -f "${SCRIPT_DIR}/utils.bash" ]]; then
source "${SCRIPT_DIR}/utils.bash"
else