mirror of
https://github.com/atom/atom.git
synced 2026-02-18 10:31:54 -05:00
Correctly handle devMode
This commit is contained in:
@@ -8,13 +8,13 @@ yargs = require 'yargs'
|
||||
console.log = require 'nslog'
|
||||
|
||||
start = ->
|
||||
args = parseCommandLine()
|
||||
|
||||
setupUncaughtExceptionHandler()
|
||||
setupAtomHome()
|
||||
setupAtomHome(args)
|
||||
setupCompileCache()
|
||||
return if handleStartupEventWithSquirrel()
|
||||
|
||||
args = parseCommandLine()
|
||||
|
||||
addPathToOpen = (event, pathToOpen) ->
|
||||
event.preventDefault()
|
||||
args.pathsToOpen.push(pathToOpen)
|
||||
@@ -56,21 +56,23 @@ handleStartupEventWithSquirrel = ->
|
||||
setupCrashReporter = ->
|
||||
crashReporter.start(productName: 'Atom', companyName: 'GitHub')
|
||||
|
||||
isPortableInstall = ->
|
||||
isPortableInstall = (args) ->
|
||||
return false unless process.platform is 'win32'
|
||||
return false unless (process and process.type)
|
||||
return false if args.devMode or args.testMode
|
||||
|
||||
ourPath = process.execPath.toLowerCase()
|
||||
return (ourPath.indexOf(process.env.LOCALAPPDATA.toLowerCase()) is 0)
|
||||
|
||||
setupAtomHome = ->
|
||||
setupAtomHome = (args) ->
|
||||
return if process.env.ATOM_HOME
|
||||
|
||||
atomHome = path.join(app.getHomeDir(), '.atom')
|
||||
try
|
||||
atomHome = fs.realpathSync(atomHome)
|
||||
fs.statSync(atomHome)
|
||||
catch
|
||||
atomHome = path.join(path.dirname(process.execPath), '.atom') if isPortableInstall()
|
||||
atomHome = path.join(path.dirname(process.execPath), '.atom') if isPortableInstall(args)
|
||||
|
||||
process.env.ATOM_HOME = atomHome
|
||||
|
||||
|
||||
Reference in New Issue
Block a user