Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(319)

Unified Diff: third_party/node/node.py

Issue 2698143003: [MD WebUI] Polymer-CSS-Build across all bundles. (Closed)
Patch Set: address comments Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/resources/vulcanize_gn.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/node/node.py
diff --git a/third_party/node/node.py b/third_party/node/node.py
index e2e9a3774ae08c7d47d30fff5d7a18a107b72449..0194f5615501a7755b286b35989132c9f4e4f960 100755
--- a/third_party/node/node.py
+++ b/third_party/node/node.py
@@ -5,6 +5,8 @@
from os import path as os_path
import platform
+import subprocess
+import sys
def GetBinaryPath():
@@ -13,3 +15,16 @@ 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
« no previous file with comments | « chrome/browser/resources/vulcanize_gn.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698