@@ -2461,7 +2461,7 @@ def process_tool_list(tools_to_activate):
2461
2461
2462
2462
2463
2463
def write_set_env_script (env_string ):
2464
- assert (WINDOWS )
2464
+ assert (CMD or POWERSHELL )
2465
2465
open (EMSDK_SET_ENV , 'w' ).write (env_string )
2466
2466
2467
2467
@@ -2478,18 +2478,18 @@ def set_active_tools(tools_to_activate, permanently_activate, system):
2478
2478
2479
2479
generate_dot_emscripten (tools_to_activate )
2480
2480
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
2484
2484
# required.
2485
- if WINDOWS :
2485
+ if CMD or POWERSHELL :
2486
2486
# always set local environment variables since permanently activating will only set the registry settings and
2487
2487
# will not affect the current session
2488
2488
env_vars_to_add = get_env_vars_to_add (tools_to_activate , system , user = permanently_activate )
2489
2489
env_string = construct_env_with_vars (env_vars_to_add )
2490
2490
write_set_env_script (env_string )
2491
2491
2492
- if permanently_activate :
2492
+ if WINDOWS and permanently_activate :
2493
2493
win_set_environment_variables (env_vars_to_add , system , user = permanently_activate )
2494
2494
2495
2495
return tools_to_activate
@@ -3101,7 +3101,7 @@ def print_tools(t):
3101
3101
tools_to_activate = currently_active_tools ()
3102
3102
tools_to_activate = process_tool_list (tools_to_activate )
3103
3103
env_string = construct_env (tools_to_activate , arg_system , arg_permanent )
3104
- if WINDOWS and not BASH :
3104
+ if CMD or POWERSHELL :
3105
3105
write_set_env_script (env_string )
3106
3106
else :
3107
3107
sys .stdout .write (env_string )
0 commit comments