Always install commands from process.resourcesPath

This commit is contained in:
Cheng Zhao
2015-03-25 19:04:19 +08:00
parent 2d9f2091c5
commit c52058ef12
2 changed files with 8 additions and 9 deletions

View File

@@ -581,9 +581,9 @@ class Atom extends Model
{resourcePath, safeMode} = @getLoadSettings()
CommandInstaller = require './command-installer'
CommandInstaller.installAtomCommand resourcePath, false, (error) ->
CommandInstaller.installAtomCommand false, (error) ->
console.warn error.message if error?
CommandInstaller.installApmCommand resourcePath, false, (error) ->
CommandInstaller.installApmCommand false, (error) ->
console.warn error.message if error?
dimensions = @restoreWindowDimensions()

View File

@@ -36,12 +36,11 @@ module.exports =
message: "Failed to install shell commands"
detailedMessage: error.message
resourcePath = process.resourcesPath
@installAtomCommand resourcePath, true, (error) =>
@installAtomCommand true, (error) =>
if error?
showErrorDialog(error)
else
@installApmCommand resourcePath, true, (error) ->
@installApmCommand true, (error) ->
if error?
showErrorDialog(error)
else
@@ -49,12 +48,12 @@ module.exports =
message: "Commands installed."
detailedMessage: "The shell commands `atom` and `apm` are installed."
installAtomCommand: (resourcePath, askForPrivilege, callback) ->
commandPath = path.join(resourcePath, 'atom.sh')
installAtomCommand: (askForPrivilege, callback) ->
commandPath = path.join(process.resourcesPath, 'atom.sh')
@createSymlink commandPath, askForPrivilege, callback
installApmCommand: (resourcePath, askForPrivilege, callback) ->
commandPath = path.join(resourcePath, 'apm', 'node_modules', '.bin', 'apm')
installApmCommand: (askForPrivilege, callback) ->
commandPath = path.join(process.resourcesPath, 'apm', 'node_modules', '.bin', 'apm')
@createSymlink commandPath, askForPrivilege, callback
createSymlink: (commandPath, askForPrivilege, callback) ->