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:
Kevin Sawicki
2014-02-24 16:38:17 -08:00
parent 0307c0e6c9
commit 336f0382b5
2 changed files with 7 additions and 15 deletions

View File

@@ -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?

View File

@@ -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}