File tree 2 files changed +11
-6
lines changed
2 files changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -2603,13 +2603,17 @@ def main():
2603
2603
2604
2604
return 0
2605
2605
elif cmd == 'construct_env':
2606
- silentremove(EMSDK_SET_ENV) # Clean up old temp file up front, in case of failure later before we get to write out the new one.
2606
+ if len(sys.argv) == 2:
2607
+ outfile = EMSDK_SET_ENV
2608
+ silentremove(EMSDK_SET_ENV) # Clean up old temp file up front, in case of failure later before we get to write out the new one.
2609
+ else:
2610
+ outfile = sys.argv[2]
2607
2611
tools_to_activate = currently_active_tools()
2608
2612
tools_to_activate = process_tool_list(tools_to_activate, log_errors=True)
2609
2613
env_string = construct_env(tools_to_activate, len(sys.argv) >= 3 and 'perm' in sys.argv[2])
2610
- open(EMSDK_SET_ENV , 'w').write(env_string)
2614
+ open(outfile , 'w').write(env_string)
2611
2615
if LINUX or OSX:
2612
- os.chmod(EMSDK_SET_ENV , 0o755)
2616
+ os.chmod(outfile , 0o755)
2613
2617
return 0
2614
2618
elif cmd == 'update':
2615
2619
update_emsdk()
Original file line number Diff line number Diff line change 14
14
# ./emsdk_env.sh
15
15
#
16
16
# which won't have any effect.
17
-
18
17
SRC=" $BASH_SOURCE "
19
18
if [ " $SRC " = " " ]; then
20
19
SRC=" $0 "
@@ -23,7 +22,9 @@ CURDIR="$(pwd)"
23
22
cd " $( dirname " $SRC " ) "
24
23
unset SRC
25
24
26
- ./emsdk construct_env " $@ "
27
- . ./emsdk_set_env.sh
25
+ tmpfile=` mktemp` || exit 1
26
+ ./emsdk construct_env " $@ " $tmpfile
27
+ . $tmpfile
28
+ rm -f $tmpfile
28
29
29
30
cd " $CURDIR "
You can’t perform that action at this time.
0 commit comments