From 558a612d37153d0a80798fb5755763e4517e57a6 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Thu, 2 Jul 2015 22:34:05 +0800 Subject: [PATCH] Install latest npm in CI --- script/bootstrap.py | 8 +++++++- script/cibuild | 3 +++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/script/bootstrap.py b/script/bootstrap.py index efe96eacbb39..36719ccb2df8 100755 --- a/script/bootstrap.py +++ b/script/bootstrap.py @@ -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(): diff --git a/script/cibuild b/script/cibuild index 4e35675f3295..4abe614dd640 100755 --- a/script/cibuild +++ b/script/cibuild @@ -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'))