mirror of
https://github.com/atom/atom.git
synced 2026-04-28 03:01:47 -04:00
Move atom/apm install helpers to CommandInstaller
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user