From ee175ad3b59730c5c61f1dfccde6b68eb4b71e05 Mon Sep 17 00:00:00 2001 From: Sam Clegg Date: Fri, 3 Mar 2023 07:37:33 -0800 Subject: [PATCH] Only add node/bin to user's PATH if one is not already found (#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 #705. --- emsdk.py | 2 ++ emsdk_manifest.json | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/emsdk.py b/emsdk.py index 62ec08dac9..196804d0a1 100644 --- a/emsdk.py +++ b/emsdk.py @@ -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 diff --git a/emsdk_manifest.json b/emsdk_manifest.json index 927cdd9bf7..b14385b655 100644 --- a/emsdk_manifest.json +++ b/emsdk_manifest.json @@ -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%" }, @@ -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%" }, @@ -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%" }, @@ -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%" },