mirror of
https://github.com/atom/atom.git
synced 2026-02-03 03:05:05 -05:00
Resolve paths to open in main.coffee
This commit is contained in:
@@ -19,23 +19,15 @@ class AtomApplication
|
||||
configWindow: null
|
||||
menu: null
|
||||
resourcePath: null
|
||||
executedFrom: null
|
||||
pathsToOpen: null
|
||||
testMode: null
|
||||
version: null
|
||||
socketPath: '/tmp/atom.sock'
|
||||
|
||||
constructor: ({@resourcePath, @executedFrom, @pathsToOpen, @testMode, @version, wait, pid}) ->
|
||||
constructor: ({@resourcePath, @pathsToOpen, @testMode, @version, wait, pid}) ->
|
||||
@pidsToOpenWindows = {}
|
||||
if @pathsToOpen?
|
||||
@pathsToOpen = @pathsToOpen.map (pathToOpen) =>
|
||||
path.resolve(@executedFrom, pathToOpen)
|
||||
else if @executedFrom
|
||||
@pathsToOpen = [@executedFrom]
|
||||
else
|
||||
@pathsToOpen = [null]
|
||||
@pathsToOpen ?= [null]
|
||||
|
||||
@executedFrom ?= process.cwd()
|
||||
pidToKillWhenClosed = pid if wait
|
||||
atomApplication = this
|
||||
@windows = []
|
||||
|
||||
@@ -36,6 +36,9 @@ parseCommandLine = ->
|
||||
|
||||
executedFrom = args['executed-from']
|
||||
pathsToOpen = if args._.length > 0 then args._ else null
|
||||
pathsToOpen ?= [executedFrom] if executedFrom
|
||||
pathsToOpen = pathsToOpen.map (pathToOpen) ->
|
||||
path.resolve(executedFrom ? process.cwd(), pathToOpen)
|
||||
testMode = true if args['test']
|
||||
wait = true if args['wait']
|
||||
pid = args['pid']
|
||||
|
||||
Reference in New Issue
Block a user