From: Cheng Zhao Date: Thu, 2 Jul 2015 14:34:05 +0000 (+0800) Subject: Install latest npm in CI X-Git-Tag: v0.29.0~2^2~12 X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=558a612d37153d0a80798fb5755763e4517e57a6;p=electron.git Install latest npm in CI --- diff --git a/script/bootstrap.py b/script/bootstrap.py index efe96eac..36719ccb 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 4e35675f..4abe614d 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'))