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

readlink -f does not work on OS X. Replaced with a python solution

This commit is contained in:
Will Thames 2012-07-30 21:09:53 +10:00
parent 6219fc4932
commit 4d4d0b90c5

View file

@ -8,7 +8,9 @@ if [ -n "$BASH_SOURCE" ] ; then
else else
HACKING_DIR="$PWD/hacking" HACKING_DIR="$PWD/hacking"
fi fi
FULL_PATH=`readlink -fn $HACKING_DIR` # The below is an alternative to readlink -fn which doesn't exist on OS X
# Source: http://stackoverflow.com/a/1678636
FULL_PATH=`python -c "import os, sys; print os.path.realpath('$HACKING_DIR')"`
ANSIBLE_HOME=`dirname $FULL_PATH` ANSIBLE_HOME=`dirname $FULL_PATH`
PREFIX_PYTHONPATH="$ANSIBLE_HOME/lib" PREFIX_PYTHONPATH="$ANSIBLE_HOME/lib"