| Index: third_party/node/node.py
|
| diff --git a/third_party/node/node.py b/third_party/node/node.py
|
| index e2e9a3774ae08c7d47d30fff5d7a18a107b72449..5a19126b634a5970cc34687c624f51f3f2fb9f5d 100755
|
| --- a/third_party/node/node.py
|
| +++ b/third_party/node/node.py
|
| @@ -5,6 +5,7 @@
|
|
|
| from os import path as os_path
|
| import platform
|
| +import subprocess
|
|
|
|
|
| def GetBinaryPath():
|
| @@ -13,3 +14,15 @@ def GetBinaryPath():
|
| 'Linux': ('linux', 'node-linux-x64', 'bin', 'node'),
|
| 'Windows': ('win', 'node.exe'),
|
| }[platform.system()])
|
| +
|
| +def RunNode(cmd_parts, stdout=None):
|
| + cmd = " ".join([GetBinaryPath()] + cmd_parts)
|
| + process = subprocess.Popen(
|
| + cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True)
|
| + stdout, stderr = process.communicate()
|
| +
|
| + if stderr:
|
| + print >> sys.stderr, '%s failed: %s' % (cmd, stderr)
|
| + raise
|
| +
|
| + return stdout
|
|
|