Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: ensure_dependencies.py

Issue 29716693: Issue 6371 - Update buildtools dep. to c830dfa08e2f, use AMO-signing API (Closed) Base URL: https://hg.adblockplus.org/abpssembly/file/1e38c3375fa3
Patch Set: Created March 9, 2018, 8:12 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ensure_dependencies.py
diff --git a/ensure_dependencies.py b/ensure_dependencies.py
index 1cbbf09522eef68283123f634370064352ec49f1..63db39758615da380e1fbd73dbd72754a7bcfe9d 100755
--- a/ensure_dependencies.py
+++ b/ensure_dependencies.py
@@ -47,7 +47,7 @@ SKIP_DEPENDENCY_UPDATES = os.environ.get(
NPM_LOCKFILE = '.npm_install_lock'
-class Mercurial():
+class Mercurial:
def istype(self, repodir):
return os.path.exists(os.path.join(repodir, '.hg'))
@@ -94,7 +94,7 @@ class Mercurial():
return url
-class Git():
+class Git:
def istype(self, repodir):
return os.path.exists(os.path.join(repodir, '.git'))
@@ -278,7 +278,16 @@ def resolve_npm_dependencies(target, vcs):
lockfile_path = os.path.join(target, NPM_LOCKFILE)
open(lockfile_path, 'a').close()
- cmd = ['npm', 'install', '--only=production', '--loglevel=warn',
+ if os.name == 'nt':
+ # Windows' CreateProcess() (called by subprocess.Popen()) only
+ # resolves executables ending in .exe. The windows installation of
+ # Node.js only provides a npm.cmd, which is executable but won't
+ # be recognized as such by CreateProcess().
+ npm_exec = 'npm.cmd'
+ else:
+ npm_exec = 'npm'
+
+ cmd = [npm_exec, 'install', '--only=production', '--loglevel=warn',
'--no-package-lock', '--no-optional']
subprocess.check_output(cmd, cwd=target)

Powered by Google App Engine
This is Rietveld