summaryrefslogtreecommitdiff
path: root/deno2/js/run_node.py
diff options
context:
space:
mode:
Diffstat (limited to 'deno2/js/run_node.py')
-rwxr-xr-xdeno2/js/run_node.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/deno2/js/run_node.py b/deno2/js/run_node.py
new file mode 100755
index 000000000..1cf74e692
--- /dev/null
+++ b/deno2/js/run_node.py
@@ -0,0 +1,14 @@
+#!/usr/bin/env python
+"""
+gn can only run python scripts.
+Also Node programs except to be run with cwd = $root_dir/js so it can resolve
+node_modules.
+"""
+import subprocess
+import sys
+import os
+
+js_path = os.path.dirname(os.path.realpath(__file__))
+os.chdir(js_path)
+args = ["node"] + sys.argv[1:]
+sys.exit(subprocess.call(args))