Skip to content

Commit 714d434

Browse files
Set environment for powershell on all platforms (#1017)
1 parent 2346baa commit 714d434

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

emsdk.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2461,7 +2461,7 @@ def process_tool_list(tools_to_activate):
24612461

24622462

24632463
def write_set_env_script(env_string):
2464-
assert(WINDOWS)
2464+
assert(CMD or POWERSHELL)
24652465
open(EMSDK_SET_ENV, 'w').write(env_string)
24662466

24672467

@@ -2478,18 +2478,18 @@ def set_active_tools(tools_to_activate, permanently_activate, system):
24782478

24792479
generate_dot_emscripten(tools_to_activate)
24802480

2481-
# Construct a .bat script that will be invoked to set env. vars and PATH
2482-
# We only do this on windows since emsdk.bat is able to modify the
2483-
# calling shell environment. On other platform `source emsdk_env.sh` is
2481+
# Construct a .bat or .ps1 script that will be invoked to set env. vars and PATH
2482+
# We only do this on cmd or powershell since emsdk.bat/ps1 is able to modify the
2483+
# calling shell environment. On other shell `source emsdk_env.sh` is
24842484
# required.
2485-
if WINDOWS:
2485+
if CMD or POWERSHELL:
24862486
# always set local environment variables since permanently activating will only set the registry settings and
24872487
# will not affect the current session
24882488
env_vars_to_add = get_env_vars_to_add(tools_to_activate, system, user=permanently_activate)
24892489
env_string = construct_env_with_vars(env_vars_to_add)
24902490
write_set_env_script(env_string)
24912491

2492-
if permanently_activate:
2492+
if WINDOWS and permanently_activate:
24932493
win_set_environment_variables(env_vars_to_add, system, user=permanently_activate)
24942494

24952495
return tools_to_activate
@@ -3101,7 +3101,7 @@ def print_tools(t):
31013101
tools_to_activate = currently_active_tools()
31023102
tools_to_activate = process_tool_list(tools_to_activate)
31033103
env_string = construct_env(tools_to_activate, arg_system, arg_permanent)
3104-
if WINDOWS and not BASH:
3104+
if CMD or POWERSHELL:
31053105
write_set_env_script(env_string)
31063106
else:
31073107
sys.stdout.write(env_string)

0 commit comments

Comments
 (0)