2018-07-08 02:24:29 -04:00
|
|
|
#!/usr/bin/env python
|
2019-01-21 14:03:30 -05:00
|
|
|
# Copyright 2018-2019 the Deno authors. All rights reserved. MIT license.
|
2018-07-08 02:24:29 -04:00
|
|
|
"""
|
|
|
|
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
|
2019-03-04 23:56:07 -05:00
|
|
|
from os import path
|
|
|
|
from util import symlink, root_path, run
|
2018-07-08 02:24:29 -04:00
|
|
|
|
2019-03-04 23:56:07 -05:00
|
|
|
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)
|
2018-07-08 02:24:29 -04:00
|
|
|
|
2019-01-24 10:54:43 -05:00
|
|
|
run(["node"] + sys.argv[1:], quiet=True)
|