Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 #!/usr/bin/env python | |
| 2 # Copyright 2017 The Chromium Authors. All rights reserved. | |
| 3 # Use of this source code is governed by a BSD-style license that can be | |
| 4 # found in the LICENSE file. | |
| 5 | |
| 6 from os import path as os_path | |
| 7 | |
| 8 | |
| 9 def GetPlatformPath(): | |
| 10 import platform | |
| 11 return os_path.join(*{ | |
| 12 'Darwin': ('mac', 'node-darwin-x64', 'bin', 'node'), | |
| 13 'Linux': ('linux', 'node-linux-x64', 'bin', 'node'), | |
| 14 'Windows': ('win', 'node.exe'), | |
| 15 }[platform.system()]) | |
| 16 | |
| 17 | |
| 18 def GetBinaryPath(): | |
| 19 return os_path.join(os_path.dirname(__file__), GetPlatformPath()) | |
| 20 | |
| 21 | |
| 22 def Run(args): | |
| 23 import subprocess | |
| 24 subprocess.Popen(' '.join([GetBinaryPath()] + args), shell=True).communicate() | |
| 25 | |
| 26 | |
| 27 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.
| |
| 28 import sys | |
| 29 Run(sys.argv[1:]) | |
| OLD | NEW |