diff options
author | Bert Belder <bertbelder@gmail.com> | 2019-03-04 20:56:07 -0800 |
---|---|---|
committer | Bert Belder <bertbelder@gmail.com> | 2019-03-04 21:01:52 -0800 |
commit | ee29ed79a7539dbc821495106da9308e6c0ef295 (patch) | |
tree | 8e80105053781f6724bb2de0f807f1537629ab8d /tools/run_node.py | |
parent | 860be9f0de0713150030428db44d326831ce6ad2 (diff) |
tools/run_node: only create 'node_modules' symlink once
Previously run_node.py would always attempt to remove and then re-create
the 'target/xx/node_modules' symlink. This causes sporadic build errors
on windows when multiple build targets that use run_node.py are being
built concurrently.
Diffstat (limited to 'tools/run_node.py')
-rwxr-xr-x | tools/run_node.py | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/tools/run_node.py b/tools/run_node.py index f1221bcd4..86e7a15b0 100755 --- a/tools/run_node.py +++ b/tools/run_node.py @@ -5,15 +5,13 @@ gn can only run python scripts. This launches a subprocess Node process. The working dir of this program is out/Debug/ (AKA root_build_dir) Before running node, we symlink js/node_modules to out/Debug/node_modules. """ -import subprocess import sys -import os -from util import remove_and_symlink, root_path, run +from os import path +from util import symlink, root_path, run -tools_path = os.path.join(root_path, "tools") -third_party_path = os.path.join(root_path, "third_party") -target_abs = os.path.join(third_party_path, "node_modules") -target_rel = os.path.relpath(target_abs) +if not path.exists("node_modules"): + target_abs = path.join(root_path, "third_party/node_modules") + target_rel = path.relpath(target_abs) + symlink(target_rel, "node_modules", True) -remove_and_symlink(target_rel, "node_modules", True) run(["node"] + sys.argv[1:], quiet=True) |