Skip to content

Commit

Permalink
Only add node/bin to user's PATH if one is not already found (emscrip…
Browse files Browse the repository at this point in the history
…ten-core#1189)

If the user already has a version of node in their PATH don't clobber
it.  This doesn't effect emscripten since the version of node we use
there is controlled via the config file, not via PATH.

Part of fix for emscripten-core#705.
  • Loading branch information
sbc100 authored and shlomif committed Sep 29, 2023
1 parent 7a71a71 commit ee175ad
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions emsdk.py
Original file line number Diff line number Diff line change
Expand Up @@ -1437,6 +1437,8 @@ def get_required_path(active_tools):
path_add = [to_native_path(EMSDK_PATH)]
for tool in active_tools:
if hasattr(tool, 'activated_path'):
if hasattr(tool, 'activated_path_skip') and which(tool.activated_path_skip):
continue
path = to_native_path(tool.expand_vars(tool.activated_path))
path_add.append(path)
return path_add
Expand Down
4 changes: 4 additions & 0 deletions emsdk_manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,7 @@
"arch": "x86",
"windows_url": "node-v14.15.5-win-x86.zip",
"activated_path": "%installation_dir%/bin",
"activated_path_skip": "node",
"activated_cfg": "NODE_JS='%installation_dir%/bin/node%.exe%'",
"activated_env": "EMSDK_NODE=%installation_dir%/bin/node%.exe%"
},
Expand All @@ -214,6 +215,7 @@
"bitness": 32,
"linux_url": "node-v14.15.5-linux-armv7l.tar.xz",
"activated_path": "%installation_dir%/bin",
"activated_path_skip": "node",
"activated_cfg": "NODE_JS='%installation_dir%/bin/node%.exe%'",
"activated_env": "EMSDK_NODE=%installation_dir%/bin/node%.exe%"
},
Expand All @@ -226,6 +228,7 @@
"windows_url": "node-v14.15.5-win-x64.zip",
"linux_url": "node-v14.15.5-linux-x64.tar.xz",
"activated_path": "%installation_dir%/bin",
"activated_path_skip": "node",
"activated_cfg": "NODE_JS='%installation_dir%/bin/node%.exe%'",
"activated_env": "EMSDK_NODE=%installation_dir%/bin/node%.exe%"
},
Expand All @@ -237,6 +240,7 @@
"macos_url": "node-v14.15.5-darwin-x64.tar.gz",
"linux_url": "node-v14.15.5-linux-arm64.tar.xz",
"activated_path": "%installation_dir%/bin",
"activated_path_skip": "node",
"activated_cfg": "NODE_JS='%installation_dir%/bin/node%.exe%'",
"activated_env": "EMSDK_NODE=%installation_dir%/bin/node%.exe%"
},
Expand Down

0 comments on commit ee175ad

Please sign in to comment.