mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2025-01-01 03:03:09 +03:00
Use correct executedFrom value for subsequent invocations
This commit is contained in:
parent
b579c21882
commit
c4fc8e55fa
@ -65,7 +65,7 @@ class AtomApplication
|
|||||||
exit: (status) -> app.exit(status)
|
exit: (status) -> app.exit(status)
|
||||||
|
|
||||||
constructor: (options) ->
|
constructor: (options) ->
|
||||||
{@resourcePath, @devResourcePath, @executedFrom, @version, @devMode, @safeMode, @socketPath} = options
|
{@resourcePath, @devResourcePath, @version, @devMode, @safeMode, @socketPath} = options
|
||||||
|
|
||||||
global.atomApplication = this
|
global.atomApplication = this
|
||||||
|
|
||||||
@ -86,11 +86,11 @@ class AtomApplication
|
|||||||
else
|
else
|
||||||
@loadState() or @openPath(options)
|
@loadState() or @openPath(options)
|
||||||
|
|
||||||
openWithOptions: ({pathsToOpen, urlsToOpen, test, pidToKillWhenClosed, devMode, safeMode, newWindow, specDirectory, logFile, profileStartup}) ->
|
openWithOptions: ({pathsToOpen, executedFrom, urlsToOpen, test, pidToKillWhenClosed, devMode, safeMode, newWindow, specDirectory, logFile, profileStartup}) ->
|
||||||
if test
|
if test
|
||||||
@runSpecs({exitWhenDone: true, @resourcePath, specDirectory, logFile})
|
@runSpecs({exitWhenDone: true, @resourcePath, specDirectory, logFile})
|
||||||
else if pathsToOpen.length > 0
|
else if pathsToOpen.length > 0
|
||||||
@openPaths({pathsToOpen, pidToKillWhenClosed, newWindow, devMode, safeMode, profileStartup})
|
@openPaths({pathsToOpen, executedFrom, pidToKillWhenClosed, newWindow, devMode, safeMode, profileStartup})
|
||||||
else if urlsToOpen.length > 0
|
else if urlsToOpen.length > 0
|
||||||
@openUrl({urlToOpen, devMode, safeMode}) for urlToOpen in urlsToOpen
|
@openUrl({urlToOpen, devMode, safeMode}) for urlToOpen in urlsToOpen
|
||||||
else
|
else
|
||||||
@ -369,8 +369,8 @@ class AtomApplication
|
|||||||
# :safeMode - Boolean to control the opened window's safe mode.
|
# :safeMode - Boolean to control the opened window's safe mode.
|
||||||
# :windowDimensions - Object with height and width keys.
|
# :windowDimensions - Object with height and width keys.
|
||||||
# :window - {AtomWindow} to open file paths in.
|
# :window - {AtomWindow} to open file paths in.
|
||||||
openPaths: ({pathsToOpen, pidToKillWhenClosed, newWindow, devMode, safeMode, windowDimensions, profileStartup, window}={}) ->
|
openPaths: ({pathsToOpen, executedFrom, pidToKillWhenClosed, newWindow, devMode, safeMode, windowDimensions, profileStartup, window}={}) ->
|
||||||
locationsToOpen = (@locationForPathToOpen(pathToOpen) for pathToOpen in pathsToOpen)
|
locationsToOpen = (@locationForPathToOpen(pathToOpen, executedFrom) for pathToOpen in pathsToOpen)
|
||||||
pathsToOpen = (locationToOpen.pathToOpen for locationToOpen in locationsToOpen)
|
pathsToOpen = (locationToOpen.pathToOpen for locationToOpen in locationsToOpen)
|
||||||
|
|
||||||
unless pidToKillWhenClosed or newWindow
|
unless pidToKillWhenClosed or newWindow
|
||||||
@ -517,7 +517,7 @@ class AtomApplication
|
|||||||
devMode = true
|
devMode = true
|
||||||
new AtomWindow({bootstrapScript, @resourcePath, exitWhenDone, isSpec, specDirectory, devMode})
|
new AtomWindow({bootstrapScript, @resourcePath, exitWhenDone, isSpec, specDirectory, devMode})
|
||||||
|
|
||||||
locationForPathToOpen: (pathToOpen) ->
|
locationForPathToOpen: (pathToOpen, executedFrom='') ->
|
||||||
return {pathToOpen} unless pathToOpen
|
return {pathToOpen} unless pathToOpen
|
||||||
|
|
||||||
pathToOpen = pathToOpen.replace(/[:\s]+$/, '')
|
pathToOpen = pathToOpen.replace(/[:\s]+$/, '')
|
||||||
@ -531,7 +531,7 @@ class AtomApplication
|
|||||||
initialLine = initialColumn = null
|
initialLine = initialColumn = null
|
||||||
|
|
||||||
unless url.parse(pathToOpen).protocol?
|
unless url.parse(pathToOpen).protocol?
|
||||||
pathToOpen = path.resolve(@executedFrom, fs.normalize(pathToOpen))
|
pathToOpen = path.resolve(executedFrom, fs.normalize(pathToOpen))
|
||||||
|
|
||||||
{pathToOpen, initialLine, initialColumn}
|
{pathToOpen, initialLine, initialColumn}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user