From 3ccd90a69004ec3397675453006e49b9a49a1155 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Mon, 28 Apr 2014 10:05:22 +0800 Subject: [PATCH 1/4] Install apm from npm, fixes #236. --- .gitmodules | 3 --- package.json | 1 + script/bootstrap.py | 37 +++++++++++++++++-------------------- vendor/apm | 1 - 4 files changed, 18 insertions(+), 24 deletions(-) delete mode 160000 vendor/apm diff --git a/.gitmodules b/.gitmodules index 5014273d2677..73ae50adbb3c 100644 --- a/.gitmodules +++ b/.gitmodules @@ -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 diff --git a/package.json b/package.json index 009f522c1960..a19b16684d2e 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/script/bootstrap.py b/script/bootstrap.py index 8a2f5e461b99..4bdc94bcb3a2 100755 --- a/script/bootstrap.py +++ b/script/bootstrap.py @@ -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' + NPM += '.cmd' - with scoped_cwd(os.path.join('vendor', 'apm')): - execute([npm, 'install', '.']) - - -def update_node_modules(): - for dirname in ['atom/browser/default_app', '.']: - update_node_modules_for_dir(dirname) - - -def update_node_modules_for_dir(dirname): +def update_node_modules(dirname): with scoped_cwd(dirname): - apm = os.path.join(SOURCE_ROOT, 'vendor', 'apm', 'bin', 'apm') + execute([NPM, 'install']) + + +def update_atom_modules(dirname): + with scoped_cwd(dirname): + 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 index 2ce1206e6720..000000000000 --- a/vendor/apm +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 2ce1206e6720c133fd2acf53bebeb9b37de2b65a From 6337888a346cd384d052d3842a15167429c09707 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Mon, 28 Apr 2014 11:42:14 +0800 Subject: [PATCH 2/4] No need to install npm any more, the one in CI is new enough. --- script/bootstrap.py | 9 --------- 1 file changed, 9 deletions(-) diff --git a/script/bootstrap.py b/script/bootstrap.py index 4bdc94bcb3a2..ba24438ee588 100755 --- a/script/bootstrap.py +++ b/script/bootstrap.py @@ -20,7 +20,6 @@ def main(): args = parse_args() update_submodules() - update_npm() update_node_modules('.') update_atom_modules('atom/browser/default_app') bootstrap_brightray(args.url) @@ -53,14 +52,6 @@ def bootstrap_brightray(url): url]) -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') - if sys.platform == 'win32': - NPM += '.cmd' - def update_node_modules(dirname): with scoped_cwd(dirname): execute([NPM, 'install']) From f762ce5d065e8af2439d429bd9bab81e00807bb9 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Mon, 28 Apr 2014 11:57:05 +0800 Subject: [PATCH 3/4] :lipstick: Fix pylint warning. --- script/bootstrap.py | 1 - 1 file changed, 1 deletion(-) diff --git a/script/bootstrap.py b/script/bootstrap.py index ba24438ee588..ed7096a95723 100755 --- a/script/bootstrap.py +++ b/script/bootstrap.py @@ -2,7 +2,6 @@ import argparse import os -import subprocess import sys from lib.config import LIBCHROMIUMCONTENT_COMMIT, BASE_URL From 9afcf80d021dc12a32a99fec75e2e1a0f5675241 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Tue, 29 Apr 2014 09:53:35 +0800 Subject: [PATCH 4/4] Upgrade to apm@0.44.x --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index a19b16684d2e..4530deeca4d4 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "version": "0.11.10", "devDependencies": { - "atom-package-manager": "0.41.x", + "atom-package-manager": "0.44.x", "coffee-script": "~1.6.3", "coffeelint": "~0.6.1", "formidable": "~1.0.14",