SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
VENDOR_DIR = os.path.join(SOURCE_ROOT, 'vendor')
-NODE_VERSION = 'v0.10.15'
BASE_URL = 'https://gh-contractor-zcbenz.s3.amazonaws.com/libchromiumcontent'
PYTHON_26_URL = 'https://chromium.googlesource.com/chromium/deps/python_26'
args = parse_args()
if not args.skip_network:
update_submodules()
- update_node()
update_apm()
update_node_modules()
bootstrap_brightray(args.url)
'--recursive'])
-def update_node():
- un = os.path.join('script', 'update-node.py')
- subprocess.check_call([sys.executable, un, '--version', NODE_VERSION])
-
-
def bootstrap_brightray(url):
bootstrap = os.path.join(VENDOR_DIR, 'brightray', 'script', 'bootstrap')
subprocess.check_call([sys.executable, bootstrap, url])
input_file = sys.argv[1]
output_dir = os.path.dirname(sys.argv[2])
- node = get_node_path()
coffee = os.path.join(SOURCE_ROOT, 'node_modules', 'coffee-script', 'bin',
'coffee')
- subprocess.check_call([node, coffee, '-c', '-o', output_dir, input_file])
+ subprocess.check_call(['node', coffee, '-c', '-o', output_dir, input_file])
if __name__ == '__main__':
+++ /dev/null
-#!/usr/bin/env python
-
-import argparse
-import errno
-import subprocess
-import stat
-import sys
-import os
-
-from lib.util import *
-
-
-SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
-NODE_VERSION = 'v0.10.15'
-NODE_DIST_URL = 'https://gh-contractor-zcbenz.s3.amazonaws.com/node/dist'
-IS_POSIX = (sys.platform != 'win32') and (sys.platform != 'cygwin')
-
-
-def main():
- os.chdir(SOURCE_ROOT)
-
- args = parse_args()
- if not node_needs_update(args.version):
- return 0
-
- url, filename = get_node_url(args.url, args.version)
- directory = tempdir(prefix='atom-shell-')
- node_path = os.path.join(directory, filename)
- download('Download node', url, node_path)
-
- if IS_POSIX:
- root_name = 'node-{0}-{1}-x86'.format(args.version, sys.platform)
- member = os.path.join(root_name, 'bin', 'node')
- extract_tarball(node_path, member, directory)
- node_path = os.path.join(directory, member)
-
- copy_node(node_path)
-
-
-def parse_args():
- parser = argparse.ArgumentParser(description='Update node binary')
- parser.add_argument('--version',
- help='Version of node',
- default=NODE_VERSION,
- required=False)
- parser.add_argument('--url',
- help='URL to download node',
- default=NODE_DIST_URL,
- required=False)
- return parser.parse_args()
-
-
-def node_needs_update(target_version):
- try:
- node = os.path.join('node', 'node')
- if not IS_POSIX:
- node += '.exe'
- version = subprocess.check_output([node, '--version'])
- return version.strip() != target_version
- except OSError as e:
- if e.errno != errno.ENOENT:
- raise
- return True
-
-
-def get_node_url(base_url, target_version):
- if IS_POSIX:
- distname = 'node-{0}-{1}-x86.tar.gz'.format(target_version, sys.platform)
- else:
- distname = 'node.exe'
- return '{0}/{1}/{2}'.format(base_url, target_version, distname), distname
-
-
-def copy_node(node_path):
- safe_mkdir('node')
- node = os.path.join('node', 'node')
- if not IS_POSIX:
- node += '.exe'
- safe_unlink(node)
- os.rename(node_path, node)
-
- st = os.stat(node)
- os.chmod(node, st.st_mode | stat.S_IEXEC)
-
-
-if __name__ == '__main__':
- sys.exit(main())