Skip to content

Commit

Permalink
Install apm to apm/ from vendor/apm
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinsawicki committed Dec 18, 2013
1 parent 0aabfdd commit ed8800d
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 4 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ debug.log
/atom-shell/
docs/output
spec/fixtures/evil-files/
/apm
12 changes: 10 additions & 2 deletions script/bootstrap
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/env node
var safeExec = require('./utils/child-process-wrapper.js').safeExec;
var fs = require('fs');
var path = require('path');

// OAuth token for atom-bot
Expand All @@ -22,13 +23,20 @@ function executeCommands(commands, done, index) {
done(null);
}

var apmVendorPath = path.resolve(__dirname, '..', 'vendor', 'apm');
var apmInstallPath = path.resolve(__dirname, '..', 'apm');
if (!fs.existsSync(apmInstallPath))
fs.mkdirSync(apmInstallPath);
if (!fs.existsSync(path.join(apmInstallPath, 'node_modules')))
fs.mkdirSync(path.join(apmInstallPath, 'node_modules'));

var apmFlags = process.env.JANKY_SHA1 || process.argv.indexOf('--no-color') !== -1 ? '--no-color' : '';
var echoNewLine = process.platform == 'win32' ? 'echo.' : 'echo';
var commands = [
'git submodule --quiet sync',
'git submodule --quiet update --recursive --init',
{command: 'npm install --quiet .', options: {cwd: path.resolve(__dirname, '..', 'vendor', 'apm'), ignoreStdout: true}},
{command: 'npm install --quiet vendor/apm', options: {ignoreStdout: true}},
{command: 'npm install --quiet', options: {cwd: apmVendorPath, ignoreStdout: true}},
{command: 'npm install --quiet ' + apmVendorPath, options: {cwd: apmInstallPath, ignoreStdout: true}},
echoNewLine,
'node node_modules/atom-package-manager/bin/apm clean ' + apmFlags,
'node node_modules/atom-package-manager/bin/apm install --quiet ' + apmFlags,
Expand Down
2 changes: 1 addition & 1 deletion src/command-installer.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -64,5 +64,5 @@ module.exports =
resourcePath = null

resourcePath ?= atom.getLoadSettings().resourcePath
commandPath = path.join(resourcePath, 'node_modules', '.bin', 'apm')
commandPath = path.join(resourcePath, 'apm', 'node_modules', '.bin', 'apm')
@install(commandPath, callback)
2 changes: 1 addition & 1 deletion src/package-manager.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class PackageManager

# Public: Get the path to the apm command
getApmPath: ->
@apmPath ?= require.resolve('atom-package-manager/bin/apm')
@apmPath ?= require.resolve('../apm/node_modules/atom-package-manager/bin/apm')

# Public: Get the paths being used to look for packages.
#
Expand Down
1 change: 1 addition & 0 deletions tasks/build-task.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ module.exports = (grunt) ->

cp 'atom.sh', path.join(appDir, 'atom.sh')
cp 'package.json', path.join(appDir, 'package.json')
cp 'apm', path.join(appDir, 'apm')

packageDirectories = []
nonPackageDirectories = [
Expand Down

0 comments on commit ed8800d

Please sign in to comment.