]> khamidou — GitHub mirrors - electron.git/commitdiff
Install apm from npm, fixes #236.
authorCheng Zhao <zcbenz@gmail.com>
Mon, 28 Apr 2014 02:05:22 +0000 (10:05 +0800)
committerCheng Zhao <zcbenz@gmail.com>
Mon, 28 Apr 2014 03:37:46 +0000 (11:37 +0800)
.gitmodules
package.json
script/bootstrap.py
vendor/apm [deleted submodule]

index 5014273d2677158138c65f21f4dd5c825a06c29d..73ae50adbb3cddec20931bc2364f4cfeb7dcbd20 100644 (file)
@@ -7,9 +7,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/atom/apm.git
 [submodule "vendor/breakpad"]
        path = vendor/breakpad
        url = https://github.com/atom/chromium-breakpad.git
index 009f522c1960aac0f8f2c5a84fa14852b4f3c96a..a19b16684d2eb645baac8e2937e86d76b9a29449 100644 (file)
@@ -3,6 +3,7 @@
   "version": "0.11.10",
 
   "devDependencies": {
+    "atom-package-manager": "0.41.x",
     "coffee-script": "~1.6.3",
     "coffeelint": "~0.6.1",
     "formidable": "~1.0.14",
index 8a2f5e461b995c7a234bce133ed86fcb4c23c684..4bdc94bcb3a2c8d52804673a8a46d1858acfb3d9 100755 (executable)
@@ -12,6 +12,7 @@ from lib.util import execute, 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 == 'win32' else 'npm'
 
 
 def main():
@@ -19,8 +20,9 @@ def main():
 
   args = parse_args()
   update_submodules()
-  update_apm()
-  update_node_modules()
+  update_npm()
+  update_node_modules('.')
+  update_atom_modules('atom/browser/default_app')
   bootstrap_brightray(args.url)
   if sys.platform == 'cygwin':
     update_win32_python()
@@ -51,30 +53,25 @@ def bootstrap_brightray(url):
            url])
 
 
-def update_apm():
-  npm = 'npm.cmd' if sys.platform == 'win32' else 'npm'
-
+def update_npm():
+  global NPM
   if os.environ.get('CI') == '1':
-    execute([npm, 'install', 'npm'])
-    npm = os.path.join(SOURCE_ROOT, 'node_modules', '.bin', 'npm')
+    execute([NPM, 'install', 'npm'])
+    NPM = os.path.join(SOURCE_ROOT, 'node_modules', '.bin', 'npm')
     if sys.platform == 'win32':
-      npm += '.cmd'
-
-  with scoped_cwd(os.path.join('vendor', 'apm')):
-    execute([npm, 'install', '.'])
+      NPM += '.cmd'
 
-
-def update_node_modules():
-  for dirname in ['atom/browser/default_app', '.']:
-    update_node_modules_for_dir(dirname)
+def update_node_modules(dirname):
+  with scoped_cwd(dirname):
+    execute([NPM, 'install'])
 
 
-def update_node_modules_for_dir(dirname):
+def update_atom_modules(dirname):
   with scoped_cwd(dirname):
-    apm = os.path.join(SOURCE_ROOT, 'vendor', 'apm', 'bin', 'apm')
+    apm = os.path.join(SOURCE_ROOT, 'node_modules', '.bin', 'apm')
     if sys.platform in ['win32', 'cygwin']:
       apm += '.cmd'
-    subprocess.check_call([apm, 'install'])
+    execute([apm, 'install'])
 
 
 def update_win32_python():
diff --git a/vendor/apm b/vendor/apm
deleted file mode 160000 (submodule)
index 2ce1206..0000000
+++ /dev/null
@@ -1 +0,0 @@
-Subproject commit 2ce1206e6720c133fd2acf53bebeb9b37de2b65a