28
emsdk
28
emsdk
@@ -6,13 +6,31 @@
|
||||
|
||||
# Wrapper script that runs emsdk.py
|
||||
|
||||
# First look for pre-built python (macos)
|
||||
if [ -z "$EMSDK_PYTHON" ]; then
|
||||
# Look for python3 first. This is especially important on macOS (See:
|
||||
# https://github.com/emscripten-core/emsdk/pull/273)
|
||||
EMSDK_PYTHON=$(which python3 2> /dev/null)
|
||||
if [ $? != 0 ]; then
|
||||
EMSDK_PYTHON=python
|
||||
PYTHON3=$(dirname $0)/python/3.7.4-2_64bit/bin/python3
|
||||
if [ -e $PYTHON3 ]; then
|
||||
EMSDK_PYTHON=$PYTHON3
|
||||
# When using our bundled python we never want the users
|
||||
# PYTHONHOME or PYTHONPATH
|
||||
# https://github.com/emscripten-core/emsdk/issues/598
|
||||
unset PYTHONHOME
|
||||
unset PYTHONPATH
|
||||
fi
|
||||
fi
|
||||
|
||||
# Look for `python3` first. This is especially important on macOS (See:
|
||||
# https://github.com/emscripten-core/emsdk/pull/273)
|
||||
if [ -z "$EMSDK_PYTHON" ]; then
|
||||
PYTHON3=$(which python3 2> /dev/null)
|
||||
if [ $? = 0 ]; then
|
||||
EMSDK_PYTHON=$PYTHON3
|
||||
fi
|
||||
fi
|
||||
|
||||
# Finally fall back to just looking for `python` in PATH
|
||||
if [ -z "$EMSDK_PYTHON" ]; then
|
||||
EMSDK_PYTHON=python
|
||||
fi
|
||||
|
||||
exec "$EMSDK_PYTHON" "$0.py" "$@"
|
||||
|
||||
Reference in New Issue
Block a user