Index: third_party/node/node.py |
diff --git a/third_party/node/node.py b/third_party/node/node.py |
new file mode 100755 |
index 0000000000000000000000000000000000000000..a52e2abab6018e13ca2d1022b6e9d45bb59b39d8 |
--- /dev/null |
+++ b/third_party/node/node.py |
@@ -0,0 +1,28 @@ |
+#!/usr/bin/env python |
+# Copyright 2016 The Chromium Authors. All rights reserved. |
+# Use of this source code is governed by a BSD-style license that can be |
+# found in the LICENSE file. |
+ |
+import os |
Dan Beam
2017/01/20 01:03:07
nit: from os import path as os_path
dpapad
2017/01/20 01:51:50
Done.
|
+import platform |
+ |
Dan Beam
2017/01/20 01:03:07
\n\n between file-level globals
dpapad
2017/01/20 01:51:50
Done.
|
+_THIRD_PARTY_NODE_DIR = os.path.join(os.path.dirname(__file__)) |
+ |
+# Gets the path to the Node binary based on current platform. |
+def get_binary(): |
+ third_party_node_binary = ''; |
+ |
+ if platform.system() == 'Darwin': |
+ third_party_node_binary = os.path.join( |
+ 'mac', 'node-darwin-x64', 'bin', 'node') |
+ elif platform.system() == 'Linux': |
+ third_party_node_binary = os.path.join( |
+ 'linux', 'node-linux-x64', 'bin', 'node') |
+ elif platform.system() == 'Windows': |
+ third_party_node_binary = os.path.join('win', 'node.exe') |
+ |
+ return os.path.abspath(os.path.join( |
+ _THIRD_PARTY_NODE_DIR, third_party_node_binary)) |
+ |
+if __name__ == '__main__': |
+ pass |
Dan Beam
2017/01/20 01:03:07
what's the point of this? could we remove it or m
dpapad
2017/01/20 01:51:50
Removed. I'll defer adding a main until it is need
|