Make emsdk_env.sh work under set -o nounset (#605)
Closes emscripten-core/emscripten#6743
This commit is contained in:
@@ -31,15 +31,15 @@ DIR="."
|
|||||||
# To add a shell, add another conditional below,
|
# To add a shell, add another conditional below,
|
||||||
# then add tests to scripts/test_source_env.sh
|
# then add tests to scripts/test_source_env.sh
|
||||||
|
|
||||||
if [ -n "$BASH_SOURCE" ]; then
|
if [ -n "${BASH_SOURCE-}" ]; then
|
||||||
CURRENT_SCRIPT="$BASH_SOURCE"
|
CURRENT_SCRIPT="$BASH_SOURCE"
|
||||||
elif [ -n "$ZSH_VERSION" ]; then
|
elif [ -n "${ZSH_VERSION-}" ]; then
|
||||||
CURRENT_SCRIPT="${(%):-%x}"
|
CURRENT_SCRIPT="${(%):-%x}"
|
||||||
elif [ -n "$KSH_VERSION" ]; then
|
elif [ -n "${KSH_VERSION-}" ]; then
|
||||||
CURRENT_SCRIPT=${.sh.file}
|
CURRENT_SCRIPT=${.sh.file}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -n "$CURRENT_SCRIPT" ]; then
|
if [ -n "${CURRENT_SCRIPT-}" ]; then
|
||||||
DIR=$(dirname "$CURRENT_SCRIPT")
|
DIR=$(dirname "$CURRENT_SCRIPT")
|
||||||
if [ -h "$CURRENT_SCRIPT" ]; then
|
if [ -h "$CURRENT_SCRIPT" ]; then
|
||||||
# Now work out actual DIR since this is part of a symlink.
|
# Now work out actual DIR since this is part of a symlink.
|
||||||
|
|||||||
Reference in New Issue
Block a user