The code for construct_env expects the output file to be at `argv[2]`,
but it is actually invoked in emsdk_env.{sh,fish} with $@ there
instead. Usually this is not a problem because the emdsk_env.{sh,fish}
is `sourced` directly from the user's shell and $@ is empty, but this
can break in scripted environments.
The $@ was added two years ago in 3b6c6b86 for no discernible reason,
but it was entirely ignored in the code until last month when #307
added a meaningful argument to construct_env but incorrectly kept the
$@.
31 lines
575 B
Bash
Executable File
31 lines
575 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
|
|
|
|
tmpfile=`mktemp` || exit 1
|
|
./emsdk construct_env $tmpfile
|
|
. $tmpfile
|
|
rm -f $tmpfile
|
|
|
|
cd "$CURDIR"
|