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