-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Hoyt Koepke
committed
May 16, 2024
1 parent
8ff9c9b
commit 1870339
Showing
3 changed files
with
45 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#!/bin/bash -e | ||
|
||
# To be sourced. Sets PYTHON_EXECUTABLE | ||
|
||
OS=$(uname -s) | ||
|
||
if [[ "$1" == "release" ]] ; then | ||
|
||
# In release mode, use the universal python executable on osx that ships with the system. However, | ||
# this doesn't allow debugging, so don't do it for non-release mode | ||
if [[ "$OS" == "Darwin" ]]; then | ||
# Use system universal one | ||
echo "/usr/bin/python3" | ||
else | ||
if [[ "$(python --version)" == "Python 3"* ]] ; then | ||
echo "$(which python)" | ||
elif [[ "$(python3 --version)" == "Python 3"* ]] ; then | ||
echo "$(which python3)" | ||
else | ||
>&2 echo "Unable to find appropriate python version." | ||
exit 1 | ||
fi | ||
fi | ||
else | ||
if [[ ! -z $PYTHON_EXECUTABLE ]] ; then | ||
echo "$PYTHON_EXECUTABLE" | ||
elif [[ "$(python --version)" == "Python 3"* ]] ; then | ||
echo "$(which python)" | ||
elif [[ "$(python3 --version)" == "Python 3"* ]] ; then | ||
echo "$(which python3)" | ||
else | ||
>&2 echo "Unable to find appropriate python version." | ||
exit 1 | ||
fi | ||
|
||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters