Chromium Code Reviews| 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..efaf859e9742338fbbd980486d049591a3ea9f55 |
| --- /dev/null |
| +++ b/third_party/node/node.py |
| @@ -0,0 +1,29 @@ |
| +#!/usr/bin/env python |
| +# Copyright 2017 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. |
| + |
| +from os import path as os_path |
| + |
| + |
| +def GetPlatformPath(): |
| + import platform |
| + return os_path.join(*{ |
| + 'Darwin': ('mac', 'node-darwin-x64', 'bin', 'node'), |
| + 'Linux': ('linux', 'node-linux-x64', 'bin', 'node'), |
| + 'Windows': ('win', 'node.exe'), |
| + }[platform.system()]) |
| + |
| + |
| +def GetBinaryPath(): |
| + return os_path.join(os_path.dirname(__file__), GetPlatformPath()) |
| + |
| + |
| +def Run(args): |
| + import subprocess |
| + subprocess.Popen(' '.join([GetBinaryPath()] + args), shell=True).communicate() |
| + |
| + |
| +if __name__ == '__main__': |
|
dpapad
2017/01/20 03:18:50
I don't think this is needed yet, so why add it?
Dan Beam
2017/01/20 17:38:11
Done.
|
| + import sys |
| + Run(sys.argv[1:]) |