fix(install-package): Point to the examples directory by default

This commit is contained in:
Ben Gotow 2015-10-03 19:09:08 -07:00
parent c20599d471
commit 05d68b1a62
3 changed files with 13 additions and 2 deletions

View file

@ -7,7 +7,12 @@ class InitialPackagesStore extends NylasStore
constructor: ->
@starterPackages = []
{resourcePath} = atom.getLoadSettings()
@starterPackagesPath = path.join(resourcePath, "examples")
if resourcePath.indexOf('app.asar') != -1
@starterPackagesPath = path.join(resourcePath,'..', 'app.asar.unpacked', 'examples')
else
@starterPackagesPath = path.join(resourcePath, "examples")
@lastError = null
@loadStarterPackages()

View file

@ -162,8 +162,15 @@ PackagesStore = Reflux.createStore
@_apm.update(pkg, pkg.newerVersion)
_onInstallPackage: ->
{resourcePath} = atom.getLoadSettings()
if resourcePath.indexOf('app.asar') != -1
starterPackagesPath = path.join(resourcePath,'..', 'app.asar.unpacked', 'examples')
else
starterPackagesPath = path.join(resourcePath, "examples")
dialog.showOpenDialog
title: "Choose a Package Directory"
defaultPath: starterPackagesPath
properties: ['openDirectory']
, (filenames) =>
return if not filenames or filenames.length is 0

View file

@ -163,7 +163,6 @@ class AccountStore
unread: threadUnread
snippet: threadMessages[0].snippet
starred: threadMessages[0].starred
labels: threadMessages[0].labels
)
messages = messages.concat(threadMessages)
threads.push(thread)