Update node before running npm.
authorCheng Zhao <zcbenz@gmail.com>
Sat, 3 Aug 2013 08:16:32 +0000 (16:16 +0800)
committerCheng Zhao <zcbenz@gmail.com>
Sat, 3 Aug 2013 08:38:02 +0000 (16:38 +0800)
.gitmodules
script/bootstrap.py
script/update.py
vendor/apm [new submodule]

index 2d9c564..b741dfe 100644 (file)
@@ -10,3 +10,6 @@
 [submodule "vendor/depot_tools"]
        path = vendor/depot_tools
        url = https://chromium.googlesource.com/chromium/tools/depot_tools.git
+[submodule "vendor/apm"]
+       path = vendor/apm
+       url = https://github.com/github/apm.git
index 3768db4..e4fd91b 100755 (executable)
@@ -11,6 +11,7 @@ from lib.util import *
 
 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'
 
@@ -21,9 +22,10 @@ def main():
   args = parse_args()
   if not args.skip_network:
     update_submodules()
+    update_node()
     update_node_modules()
     bootstrap_brightray(args.url)
-    if sys.platform == 'cygwin':
+    if sys.platform is 'cygwin':
       update_win32_python()
 
   touch_config_gypi()
@@ -50,6 +52,11 @@ def update_submodules():
                          '--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])
index acb2084..38c0247 100755 (executable)
@@ -7,29 +7,25 @@ from lib.util import *
 
 
 SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
-NODE_VERSION = 'v0.10.15'
 
 
 def main():
   os.chdir(SOURCE_ROOT)
 
-  update_frameworks_and_node(NODE_VERSION)
+  update_frameworks()
   update_gyp()
 
 
-def update_frameworks_and_node(version):
-  if sys.platform == 'darwin':
+def update_frameworks():
+  if sys.platform is 'darwin':
     uf = os.path.join('script', 'update-frameworks.py')
     subprocess.check_call([sys.executable, uf])
 
-  un = os.path.join('script', 'update-node.py')
-  subprocess.check_call([sys.executable, un, '--version', version])
-
 
 def update_gyp():
   gyp = os.path.join('vendor', 'gyp', 'gyp_main.py')
   python = sys.executable
-  if sys.platform == 'cygwin':
+  if sys.platform is 'cygwin':
     python = os.path.join('vendor', 'python_26', 'python.exe')
   subprocess.call([python, gyp,
                    '-f', 'ninja', '--depth', '.', 'atom.gyp',
diff --git a/vendor/apm b/vendor/apm
new file mode 160000 (submodule)
index 0000000..1cda00c
--- /dev/null
@@ -0,0 +1 @@
+Subproject commit 1cda00c8507bad369b08a507907a7f96d27f022c