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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « chrome/browser/resources/vulcanize_gn.py ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright 2017 The Chromium Authors. All rights reserved. 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 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 from os import path as os_path 6 from os import path as os_path
7 import platform 7 import platform
8 import subprocess
9 import sys
8 10
9 11
10 def GetBinaryPath(): 12 def GetBinaryPath():
11 return os_path.join(os_path.dirname(__file__), *{ 13 return os_path.join(os_path.dirname(__file__), *{
12 'Darwin': ('mac', 'node-darwin-x64', 'bin', 'node'), 14 'Darwin': ('mac', 'node-darwin-x64', 'bin', 'node'),
13 'Linux': ('linux', 'node-linux-x64', 'bin', 'node'), 15 'Linux': ('linux', 'node-linux-x64', 'bin', 'node'),
14 'Windows': ('win', 'node.exe'), 16 'Windows': ('win', 'node.exe'),
15 }[platform.system()]) 17 }[platform.system()])
18
19
20 def RunNode(cmd_parts, stdout=None):
21 cmd = " ".join([GetBinaryPath()] + cmd_parts)
22 process = subprocess.Popen(
23 cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True)
24 stdout, stderr = process.communicate()
25
26 if stderr:
27 print >> sys.stderr, '%s failed: %s' % (cmd, stderr)
28 raise
29
30 return stdout
OLDNEW
« 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