1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-22 15:06:54 -05:00
denoland-deno/tools/run_node.py
Bert Belder ee29ed79a7
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.
2019-03-04 21:01:52 -08:00

17 lines
624 B
Python
Executable file

#!/usr/bin/env python
# Copyright 2018-2019 the Deno authors. All rights reserved. MIT license.
"""
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 sys
from os import path
from util import symlink, root_path, run
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)
run(["node"] + sys.argv[1:], quiet=True)