diff --git a/enjarify.sh b/enjarify.sh index baa03c3..0441b1f 100755 --- a/enjarify.sh +++ b/enjarify.sh @@ -36,7 +36,13 @@ else echo "Using $PYTHON as Python interpreter" # Find location of this bash script, and set its directory as the PYTHONPATH - export PYTHONPATH=$(dirname "$(readlink -f "${BASH_SOURCE[0]}")") + if [[ "$OSTYPE" == "darwin"* ]]; then + READLINK="readlink" + else + READLINK="readlink -f" + fi + + export PYTHONPATH=$(dirname "$($READLINK "${BASH_SOURCE[0]}")") # Now execute the actual program exec $PYTHON -O -m enjarify.main "$@"