summaryrefslogtreecommitdiff
path: root/src/js/run_node.py
diff options
context:
space:
mode:
authorYoshiya Hinosawa <stibium121@gmail.com>2018-07-01 23:37:10 +0900
committerRyan Dahl <ry@tinyclouds.org>2018-07-01 17:22:36 +0200
commitea35281d637cf326c4d808111a59d986c92e6a4b (patch)
treec02b9836c4d5736aec2a412c2f82c589ed4c1d33 /src/js/run_node.py
parent9528ee4a42eb0729a4467ddaaa3be573d9053fa2 (diff)
chore: move //src/js to //js
refs: #285
Diffstat (limited to 'src/js/run_node.py')
-rwxr-xr-xsrc/js/run_node.py39
1 files changed, 0 insertions, 39 deletions
diff --git a/src/js/run_node.py b/src/js/run_node.py
deleted file mode 100755
index 506f2be4c..000000000
--- a/src/js/run_node.py
+++ /dev/null
@@ -1,39 +0,0 @@
-#!/usr/bin/env python
-"""
-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
-
-
-def symlink(target, name, target_is_dir=False):
- if os.name == "nt":
- import ctypes
- CreateSymbolicLinkW = ctypes.windll.kernel32.CreateSymbolicLinkW
- CreateSymbolicLinkW.restype = ctypes.c_ubyte
- CreateSymbolicLinkW.argtypes = (ctypes.c_wchar_p, ctypes.c_wchar_p,
- ctypes.c_uint32)
-
- flags = 0x02 # SYMBOLIC_LINK_FLAG_ALLOW_UNPRIVILEGED_CREATE
- if (target_is_dir):
- flags |= 0x01 # SYMBOLIC_LINK_FLAG_DIRECTORY
- if not CreateSymbolicLinkW(name, target, flags):
- raise ctypes.WinError()
- else:
- os.symlink(target, name)
-
-
-js_path = os.path.dirname(os.path.realpath(__file__))
-target_abs = os.path.join(js_path, "node_modules")
-target_rel = os.path.relpath(target_abs)
-
-if not os.path.exists("node_modules"):
- if os.path.lexists("node_modules"):
- os.unlink("node_modules")
- symlink(target_rel, "node_modules", True)
-
-args = ["node"] + sys.argv[1:]
-sys.exit(subprocess.call(args))