Skip to content

Commit b1bb477

Browse files
Add double-quotes to allow spaces in path (#1097)
1 parent 21611d2 commit b1bb477

File tree

2 files changed

+10
-11
lines changed

2 files changed

+10
-11
lines changed

emsdk

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@
88

99
# First look for python bundled in Emsdk
1010
if [ -z "$EMSDK_PYTHON" ]; then
11-
PYTHON3=$(dirname $0)/python/3.9.2-1_64bit/bin/python3
12-
PYTHON3_CERT_FILE=$(dirname $0)/python/3.9.2-1_64bit/lib/python3.9/site-packages/certifi/cacert.pem
13-
if [ ! -f $PYTHON3 ]; then
14-
PYTHON3=$(dirname $0)/python/3.7.4-2_64bit/bin/python3
15-
PYTHON3_CERT_FILE=$(dirname $0)/python/3.7.4-2_64bit/lib/python3.7/site-packages/certifi/cacert.pem
11+
PYTHON3="$(dirname "$0")/python/3.9.2-1_64bit/bin/python3"
12+
PYTHON3_CERT_FILE="$(dirname "$0")/python/3.9.2-1_64bit/lib/python3.9/site-packages/certifi/cacert.pem"
13+
if [ ! -f "$PYTHON3" ]; then
14+
PYTHON3="$(dirname "$0")/python/3.7.4-2_64bit/bin/python3"
15+
PYTHON3_CERT_FILE="$(dirname "$0")/python/3.7.4-2_64bit/lib/python3.7/site-packages/certifi/cacert.pem"
1616
fi
17-
if [ -f $PYTHON3 ]; then
18-
EMSDK_PYTHON=$PYTHON3
17+
if [ -f "$PYTHON3" ]; then
18+
EMSDK_PYTHON="$PYTHON3"
1919

2020
# When using our bundled python we never want the users
2121
# PYTHONHOME or PYTHONPATH
@@ -26,15 +26,14 @@ if [ -z "$EMSDK_PYTHON" ]; then
2626
# This is needed for MacOS. Without this, the urlopen
2727
# code will try to use /usr/local/etc/openssl/cert.pem
2828
# which may or may not exist on the system.
29-
export SSL_CERT_FILE=$PYTHON3_CERT_FILE
29+
export SSL_CERT_FILE="$PYTHON3_CERT_FILE"
3030
fi
3131
fi
3232

3333
# If bundled python is not found, look for `python3` in PATH. This is especially important on macOS (See:
3434
# https://github.com/emscripten-core/emsdk/pull/273)
3535
if [ -z "$EMSDK_PYTHON" ]; then
36-
PYTHON3=$(which python3 2> /dev/null)
37-
if [ $? = 0 ]; then
36+
if PYTHON3="$(which python3 2>/dev/null)"; then
3837
EMSDK_PYTHON=$PYTHON3
3938
fi
4039
fi

emsdk_env.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,5 +69,5 @@ if [ ! -f "$DIR/emsdk.py" ]; then
6969
fi
7070

7171
# Force emsdk to use bash syntax so that this works in windows + bash too
72-
eval `EMSDK_BASH=1 $DIR/emsdk construct_env`
72+
eval `EMSDK_BASH=1 "$DIR/emsdk" construct_env`
7373
unset DIR

0 commit comments

Comments
 (0)