mirror of
https://github.com/atom/atom.git
synced 2026-01-22 13:28:01 -05:00
Don't require ~/github/atom for dev mode windows
Use ~/github/atom when available but keep the dev mode flag on the window's load settings even when it does not exist. Changes both cmd-shift-o and `atom --dev`
This commit is contained in:
@@ -321,14 +321,6 @@ class AtomApplication
|
||||
# + initialSize:
|
||||
# Object with height and width keys.
|
||||
openPath: ({pathToOpen, pidToKillWhenClosed, newWindow, devMode, initialSize}={}) ->
|
||||
if devMode and not fs.existsSync(global.devResourcePath)
|
||||
dialog.showMessageBox
|
||||
type: 'warning'
|
||||
buttons: ['OK']
|
||||
message: 'Atom source directory not found.'
|
||||
detail: 'To run a window in dev mode you need to have the atom/atom repo cloned to ~/github/atom'
|
||||
return
|
||||
|
||||
if pathToOpen
|
||||
[basename, initialLine] = path.basename(pathToOpen).split(':')
|
||||
if initialLine
|
||||
@@ -342,11 +334,12 @@ class AtomApplication
|
||||
openedWindow.openPath(pathToOpen, initialLine)
|
||||
else
|
||||
if devMode
|
||||
resourcePath = global.devResourcePath
|
||||
bootstrapScript = require.resolve(path.join(global.devResourcePath, 'src', 'window-bootstrap'))
|
||||
else
|
||||
resourcePath = @resourcePath
|
||||
bootstrapScript = require.resolve('../window-bootstrap')
|
||||
try
|
||||
bootstrapScript = require.resolve(path.join(global.devResourcePath, 'src', 'window-bootstrap'))
|
||||
resourcePath = global.devResourcePath
|
||||
|
||||
bootstrapScript ?= require.resolve('../window-bootstrap')
|
||||
resourcePath ?= @resourcePath
|
||||
openedWindow = new AtomWindow({pathToOpen, initialLine, bootstrapScript, resourcePath, devMode, initialSize})
|
||||
|
||||
if pidToKillWhenClosed?
|
||||
|
||||
@@ -109,8 +109,7 @@ parseCommandLine = ->
|
||||
|
||||
try
|
||||
fs.statSync resourcePath
|
||||
catch e
|
||||
devMode = false
|
||||
catch
|
||||
resourcePath = path.dirname(path.dirname(__dirname))
|
||||
|
||||
{resourcePath, pathsToOpen, executedFrom, test, version, pidToKillWhenClosed, devMode, newWindow, specDirectory, logFile}
|
||||
|
||||
Reference in New Issue
Block a user