Skip to content

Commit

Permalink
Fix readlink call on macOS, keep Linux compat (closes #11)
Browse files Browse the repository at this point in the history
  • Loading branch information
zyv authored and Storyyeller committed Nov 3, 2019
1 parent 8a47edf commit b5dccde
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion enjarify.sh
Expand Up @@ -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 "$@"
Expand Down

0 comments on commit b5dccde

Please sign in to comment.