1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-14 16:33:45 -05:00
denoland-deno/tools/run_node.py

20 lines
711 B
Python
Raw Normal View History

#!/usr/bin/env python
2019-01-21 14:03:30 -05:00
# 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 subprocess
import sys
import os
2019-01-24 10:54:43 -05:00
from util import remove_and_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)
2019-01-24 10:54:43 -05:00
remove_and_symlink(target_rel, "node_modules", True)
run(["node"] + sys.argv[1:], quiet=True)