Resolve paths to open in main.coffee

This commit is contained in:
Corey Johnson & Kevin Sawicki
2013-05-29 14:39:20 -07:00
parent 608fcbd0a1
commit 3373549e56
2 changed files with 5 additions and 10 deletions

View File

@@ -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 = []

View File

@@ -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']