Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions emsdk.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,11 @@ def emsdk_path():
if os.path.exists(os.path.join(emsdk_path(), '.emscripten')):
emscripten_config_directory = emsdk_path()

EMSDK_SET_ENV = os.path.join(emsdk_path(), 'emsdk_set_env.bat')
EMSDK_SET_ENV = ""
if POWERSHELL:
EMSDK_SET_ENV = os.path.join(emsdk_path(), 'emsdk_set_env.ps1')
else:
EMSDK_SET_ENV = os.path.join(emsdk_path(), 'emsdk_set_env.bat')

ARCHIVE_SUFFIXES = ('zip', '.tar', '.gz', '.xz', '.tbz2', '.bz2')

Expand Down Expand Up @@ -2467,7 +2471,7 @@ def copy_pregenerated_cache(tools_to_activate):
os.path.join(out_cache, filename))


def write_set_env_bat(env_string):
def write_set_env_script(env_string):
assert(WINDOWS)
open(EMSDK_SET_ENV, 'w').write(env_string)

Expand Down Expand Up @@ -2496,7 +2500,7 @@ def set_active_tools(tools_to_activate, permanently_activate):
# required.
if WINDOWS:
env_string = construct_env(tools_to_activate)
write_set_env_bat(env_string)
write_set_env_script(env_string)

# Apply environment variables to global all users section.
if WINDOWS and permanently_activate:
Expand Down Expand Up @@ -3024,7 +3028,7 @@ def print_tools(t):
tools_to_activate = process_tool_list(tools_to_activate, log_errors=True)
env_string = construct_env(tools_to_activate)
if WINDOWS and not BASH:
write_set_env_bat(env_string)
write_set_env_script(env_string)
else:
sys.stdout.write(env_string)
return 0
Expand Down