Move atom/apm install helpers to CommandInstaller

This commit is contained in:
Kevin Sawicki
2013-11-22 09:51:21 -08:00
parent 754b5a6004
commit 3320176a0a
2 changed files with 13 additions and 12 deletions

View File

@@ -47,3 +47,13 @@ module.exports =
symlinkCommand(commandPath, destinationPath, installCallback)
else
installCallback(new Error("No destination directory exists to install"))
installAtomCommand: (callback) ->
{resourcePath} = atom.getLoadSettings()
commandPath = path.join(resourcePath, 'atom.sh')
@install(commandPath, callback)
installApmCommand: (callback) ->
{resourcePath} = atom.getLoadSettings()
commandPath = path.join(resourcePath, 'node_modules', '.bin', 'apm')
@install(commandPath, callback)

View File

@@ -20,8 +20,9 @@ window.setUpDefaultEvents = ->
# This method is only called when opening a real application window
window.startEditorWindow = ->
if process.platform is 'darwin'
installAtomCommand()
installApmCommand()
CommandInstaller = require './command-installer'
CommandInstaller.installAtomCommand()
CommandInstaller.installApmCommand()
windowEventHandler = new WindowEventHandler
atom.restoreDimensions()
@@ -56,16 +57,6 @@ window.unloadEditorWindow = ->
atom.project.destroy()
windowEventHandler?.unsubscribe()
installAtomCommand = (callback) ->
{resourcePath} = atom.getLoadSettings()
commandPath = path.join(resourcePath, 'atom.sh')
require('./command-installer').install(commandPath, callback)
installApmCommand = (callback) ->
{resourcePath} = atom.getLoadSettings()
commandPath = path.join(resourcePath, 'node_modules', '.bin', 'apm')
require('./command-installer').install(commandPath, callback)
window.onerror = ->
atom.openDevTools()