It seems that some variables were mistakenly left unquoted, leading to paths containing spaces being treated incorrectly. For example, the directory `/home/person/foo bar/test/` would cause `CURDIR=$(pwd)` to be expanded to `CURDIR=/home/person/foo bar/test/`. This means that the shell would attempt to run the command `bar/test/` with the environment variable `CURDIR` set to `/home/person/foo`. This is due to [word splitting](https://www.gnu.org/software/bash/manual/html_node/Word-Splitting.html). (TL;DR the result of shell expansions should probably be quoted 99% of the time)
30 lines
540 B
Bash
Executable File
30 lines
540 B
Bash
Executable File
# This script is sourced by the user and uses
|
|
# their shell. Try not to use bashisms.
|
|
|
|
# Do not execute this script without sourcing,
|
|
# because it won't have any effect then.
|
|
# That is, always run this script with
|
|
#
|
|
# . ./emsdk_env.sh
|
|
# or
|
|
# source ./emsdk_env.sh
|
|
#
|
|
# instead of just plainly running with
|
|
#
|
|
# ./emsdk_env.sh
|
|
#
|
|
# which won't have any effect.
|
|
|
|
SRC="$BASH_SOURCE"
|
|
if [ "$SRC" = "" ]; then
|
|
SRC="$0"
|
|
fi
|
|
CURDIR="$(pwd)"
|
|
cd "$(dirname "$SRC")"
|
|
unset SRC
|
|
|
|
./emsdk construct_env "$@"
|
|
. ./emsdk_set_env.sh
|
|
|
|
cd "$CURDIR"
|