Install latest npm in CI

This commit is contained in:
Cheng Zhao 2015-07-02 22:34:05 +08:00
parent 5ccc909f2f
commit 558a612d37
2 changed files with 10 additions and 1 deletions

View file

@ -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():

View file

@ -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'))