fix(onboarding): Do not open plugin folders after install

This commit is contained in:
Ben Gotow 2015-10-23 11:58:33 -07:00
parent d4053d00fe
commit ea23796bf8
2 changed files with 7 additions and 6 deletions

View file

@ -174,13 +174,15 @@ PackagesStore = Reflux.createStore
properties: ['openDirectory']
, (filenames) =>
return if not filenames or filenames.length is 0
atom.packages.installPackageFromPath filenames[0], (err) =>
atom.packages.installPackageFromPath filenames[0], (err, packageTargetDir) =>
return if err
packageName = path.basename(filenames[0])
msg = "#{packageName} has been installed and enabled. No need to \
restart! If you don't see the package loaded, check the \
console for errors."
@_displayMessage("Package installed", msg)
if packageTargetDir
shell.showItemInFolder(packageTargetDir)
_onCreatePackage: ->
if not atom.inDevMode()

View file

@ -327,7 +327,7 @@ class PackageManager
packageTargetDir = path.join(packagesDir, packageName)
fs.makeTree packagesDir, (err) =>
return callback(err) if err
return callback(err, null) if err
fs.exists packageTargetDir, (packageAlreadyExists) =>
if packageAlreadyExists
@ -340,14 +340,13 @@ class PackageManager
detail: 'Remove it before trying to install another package of the same name.'
message: message
})
callback(new Error(message))
callback(new Error(message), null)
return
fs.copySync(packageSourceDir, packageTargetDir)
apm = new APMWrapper()
apm.installDependenciesInPackageDirectory packageTargetDir, (err) =>
shell.showItemInFolder(packageTargetDir)
if err
dialog.showMessageBox({
type: 'warning'
@ -355,11 +354,11 @@ class PackageManager
title: 'Package installation failed'
message: err.toString()
})
callback(err)
callback(err, packageTargetDir)
else
@enablePackage(packageTargetDir)
@activatePackage(packageName)
callback(null)
callback(null, packageTargetDir)
###
Section: Private