Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions emsdk_env.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#!/bin/sh
# This script is sourced by the user and uses
# their shell. Try not to use bashisms.

Expand All @@ -15,11 +14,14 @@
# ./emsdk_env.sh
#
# which won't have any effect.
DIR="$BASH_SOURCE"
if [ "$DIR" = "" ]; then
DIR="$0"
if [ -z "$BASH_SOURCE" ]; then
if [ ! -f "./emsdk.py" ]; then
echo "error: You must be in the same directory as emsdk_env.sh when sourcing it (or switch to the bash shell)" 1>&2
fi
DIR="."
else
DIR="$(dirname "$BASH_SOURCE")"
fi
DIR="$(dirname "$DIR")"

# Force emsdk to use bash syntax so that this works in windows + bash too
eval `EMSDK_BASH=1 $DIR/emsdk construct_env`
Expand Down