mirror of
https://github.com/atom/atom.git
synced 2026-01-22 21:38:10 -05:00
Make atom.open work with parameters.
This commit is contained in:
@@ -153,11 +153,8 @@ window.atom =
|
||||
themeNames = config.get("core.themes") ? ['atom-dark-ui', 'atom-dark-syntax']
|
||||
themeNames = [themeNames] unless _.isArray(themeNames)
|
||||
|
||||
open: (url) ->
|
||||
if url
|
||||
throw new Error('opening a url does not currently work', url)
|
||||
else
|
||||
ipc.sendChannel('open-folder')
|
||||
open: (url...) ->
|
||||
ipc.sendChannel('open', [url...])
|
||||
|
||||
openDev: (url) ->
|
||||
console.error("atom.openDev does not work yet")
|
||||
|
||||
@@ -155,10 +155,12 @@ class AtomApplication
|
||||
ipc.on 'open-config', =>
|
||||
@openConfig()
|
||||
|
||||
ipc.on 'open-folder', =>
|
||||
currentWindow = BrowserWindow.getFocusedWindow()
|
||||
pathsToOpen = dialog.showOpenDialog title: 'Open', properties: ['openFile', 'openDirectory', 'multiSelections', 'createDirectory']
|
||||
@open(pathToOpen) for pathToOpen in pathsToOpen if pathsToOpen?
|
||||
ipc.on 'open', (processId, routingId, pathsToOpen) =>
|
||||
if not pathsToOpen
|
||||
pathsToOpen = dialog.showOpenDialog title: 'Open', properties: ['openFile', 'openDirectory', 'multiSelections', 'createDirectory']
|
||||
@open(pathsToOpen) if pathsToOpen?
|
||||
else
|
||||
@open(pathsToOpen)
|
||||
|
||||
ipc.on 'new-window', =>
|
||||
@open()
|
||||
|
||||
Reference in New Issue
Block a user