mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2024-11-10 10:17:11 +03:00
Make cli installation work with install-cli script
This commit is contained in:
parent
399c4f9f95
commit
d2e4c61e0b
@ -3,9 +3,8 @@
|
||||
path = require 'path'
|
||||
CommandInstaller = require '../src/command-installer'
|
||||
|
||||
callback = (error, sourcePath, destinationPath) ->
|
||||
unless error?
|
||||
console.log "#{sourcePath} intalled to #{destinationPath}"
|
||||
callback = (error) ->
|
||||
console.warn error.message if error?
|
||||
|
||||
CommandInstaller.installAtomCommand(path.resolve(__dirname, '..'), callback)
|
||||
CommandInstaller.installApmCommand(path.resolve(__dirname, '..'), callback)
|
||||
|
@ -250,8 +250,11 @@ class Atom extends Model
|
||||
# Private: Call this method when establishing a real application window.
|
||||
startEditorWindow: ->
|
||||
CommandInstaller = require './command-installer'
|
||||
CommandInstaller.installAtomCommand (error) -> console.warn error.message if error?
|
||||
CommandInstaller.installApmCommand (error) -> console.warn error.message if error?
|
||||
resourcePath = atom.getLoadSettings().resourcePath
|
||||
CommandInstaller.installAtomCommand resourcePath, (error) ->
|
||||
console.warn error.message if error?
|
||||
CommandInstaller.installApmCommand resourcePath, (error) ->
|
||||
console.warn error.message if error?
|
||||
|
||||
@restoreWindowDimensions()
|
||||
@config.load()
|
||||
|
@ -45,12 +45,10 @@ module.exports =
|
||||
error = new Error "Directory '#{directory} doesn't exist."
|
||||
callback?(error)
|
||||
|
||||
installAtomCommand: (callback) ->
|
||||
resourcePath = atom.getLoadSettings().resourcePath
|
||||
installAtomCommand: (resourcePath, callback) ->
|
||||
commandPath = path.join(resourcePath, 'atom.sh')
|
||||
@install commandPath, callback
|
||||
|
||||
installApmCommand: (callback) ->
|
||||
resourcePath = atom.getLoadSettings().resourcePath
|
||||
installApmCommand: (resourcePath, callback) ->
|
||||
commandPath = path.join(resourcePath, 'apm', 'node_modules', '.bin', 'apm')
|
||||
@install commandPath, callback
|
||||
|
@ -146,10 +146,12 @@ class WorkspaceView extends View
|
||||
message: "Command installed."
|
||||
detailedMessage: "The shell command `#{commandName}` is installed."
|
||||
|
||||
CommandInstaller.installApmCommand (error) =>
|
||||
resourcePath = atom.getLoadSettings().resourcePath
|
||||
CommandInstaller.installApmCommand resourcePath, (error) =>
|
||||
showDialog(error, 'atom')
|
||||
unless error?
|
||||
CommandInstaller.installApmCommand (error) => showDialog(error, 'apm')
|
||||
CommandInstaller.installApmCommand resourcePath, (error) =>
|
||||
showDialog(error, 'apm')
|
||||
|
||||
# Private:
|
||||
handleFocus: (e) ->
|
||||
|
Loading…
Reference in New Issue
Block a user