Avoid writing to file in emsdk_env.csh / emsdk_env.sh (#544)

This is an alternative fix for
https://github.com/emscripten-core/emscripten/issues/9090 which recently
came up again after #539.

Tested with bash, tcsh and fish.
This commit is contained in:
Sam Clegg
2020-07-10 17:49:16 -07:00
committed by GitHub
parent 833dfddcdc
commit d37abed2de
5 changed files with 35 additions and 43 deletions

11
emsdk_env.csh Executable file → Normal file
View File

@@ -5,8 +5,6 @@
# because it won't have any effect then.
# That is, always run this script with
#
# . ./emsdk_env.csh
# or
# source ./emsdk_env.csh
#
# instead of just plainly running with
@@ -18,16 +16,15 @@ set SRC=($_)
if ("$SRC" == "") then
set SRC="$0"
else
set SRC="$SRC[2]"
set SRC="$SRC[1]"
endif
set CURDIR=`pwd`
set DIR=`dirname "$SRC"`
setenv DIR `dirname "$SRC"`
unset SRC
setenv EMSDK_CSH 1
$DIR/emsdk construct_env
source $DIR/emsdk_set_env.csh
unset DIR
eval `$DIR/emsdk construct_env`
unsetenv DIR
unsetenv EMSDK_CSH