]> khamidou — GitHub mirrors - electron.git/commitdiff
Install latest npm in CI
authorCheng Zhao <zcbenz@gmail.com>
Thu, 2 Jul 2015 14:34:05 +0000 (22:34 +0800)
committerCheng Zhao <zcbenz@gmail.com>
Thu, 2 Jul 2015 14:34:05 +0000 (22:34 +0800)
script/bootstrap.py
script/cibuild

index efe96eacbb3928f1849d7caaf5a95fafc80f8fd6..36719ccb2df8bcb05a6d09e20e497dece877c92b 100755 (executable)
@@ -12,7 +12,13 @@ from lib.util import execute_stdout, get_atom_shell_version, scoped_cwd
 SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
 VENDOR_DIR = os.path.join(SOURCE_ROOT, 'vendor')
 PYTHON_26_URL = 'https://chromium.googlesource.com/chromium/deps/python_26'
-NPM = 'npm.cmd' if sys.platform in ['win32', 'cygwin'] else 'npm'
+
+if os.environ.has_key('CI'):
+  NPM = os.path.join(SOURCE_ROOT, 'node_modules', '.bin', 'npm')
+else:
+  NPM = 'npm'
+if sys.platform in ['win32', 'cygwin']:
+  NPM += '.cmd'
 
 
 def main():
index 4e35675f32953a10de9d8217eeb39ef6250427de..4abe614dd6400657fe5d95239eea50cf79342fdc 100755 (executable)
@@ -45,6 +45,9 @@ def main():
     os.environ['DISPLAY'] = ':99.0'
     execute(['sh', '-e', '/etc/init.d/xvfb', 'start'])
 
+  # CI's npm is not reliable.
+  execute(['npm', 'install', 'npm'])
+
   rm_rf(os.path.join(SOURCE_ROOT, 'out'))
   rm_rf(os.path.join(SOURCE_ROOT, 'node_modules'))
   rm_rf(os.path.join(SOURCE_ROOT, 'frameworks'))