Files
ci-emsdk/emsdk_env.sh
Sam Clegg a8263f30af Allow EMCC_BASH to force bash during construct_env (#493)
This allows `emsdk_env.sh` to work under bash for windows even in the
absence of the `MSYSTEM` environment variable (which seems to be 
the setup on circle CI.
2020-05-07 08:31:02 -07:00

33 lines
674 B
Bash
Executable File

#!/bin/bash
# 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
# Force emsdk to use bash syntax so that this works in windows + bash too
EMSDK_BASH=1 ./emsdk construct_env $tmpfile
. $tmpfile
rm -f $tmpfile
cd "$CURDIR"