Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "atom-package-manager",
"description": "Atom package manager",
"version": "1.18.3",
"version": "1.18.4-0",
"license": "MIT",
"repository": {
"type": "git",
Expand Down
18 changes: 11 additions & 7 deletions src/apm.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -26,24 +26,28 @@ module.exports =

apmFolder = path.resolve(__dirname, '..')
appFolder = path.dirname(apmFolder)
if path.basename(apmFolder) is 'apm' and path.basename(appFolder) is 'app' and fs.existsSync(appFolder)
return process.nextTick -> callback(appFolder)
if path.basename(apmFolder) is 'apm' and path.basename(appFolder) is 'app'
asarPath = "#{appFolder}.asar"
if fs.existsSync(asarPath)
return process.nextTick -> callback(asarPath)

apmFolder = path.resolve(__dirname, '..', '..', '..')
appFolder = path.dirname(apmFolder)
if path.basename(apmFolder) is 'apm' and path.basename(appFolder) is 'app' and fs.existsSync(appFolder)
return process.nextTick -> callback(appFolder)
if path.basename(apmFolder) is 'apm' and path.basename(appFolder) is 'app'
asarPath = "#{appFolder}.asar"
if fs.existsSync(asarPath)
return process.nextTick -> callback(asarPath)

switch process.platform
when 'darwin'
child_process.exec 'mdfind "kMDItemCFBundleIdentifier == \'com.github.atom\'"', (error, stdout='', stderr) ->
[appLocation] = stdout.split('\n') unless error
appLocation = '/Applications/Atom.app' unless appLocation
callback("#{appLocation}/Contents/Resources/app")
callback("#{appLocation}/Contents/Resources/app.asar")
when 'linux'
appLocation = '/usr/local/share/atom/resources/app'
appLocation = '/usr/local/share/atom/resources/app.asar'
unless fs.existsSync(appLocation)
appLocation = '/usr/share/atom/resources/app'
appLocation = '/usr/share/atom/resources/app.asar'
process.nextTick -> callback(appLocation)

getReposDirectory: ->
Expand Down