mirror of
https://github.com/atom/atom.git
synced 2026-01-23 13:58:08 -05:00
Add global.homeDir
Ick, this should be handled by an npm or hopefully a patch to Node.
This commit is contained in:
@@ -261,7 +261,7 @@ class AtomApplication
|
||||
runSpecs: (exitWhenDone) ->
|
||||
specWindow = new AtomWindow
|
||||
bootstrapScript: 'spec-bootstrap'
|
||||
resourcePath: path.join(@getHomeDir(), 'github', 'atom')
|
||||
resourcePath: path.join(global.homeDir, 'github', 'atom')
|
||||
exitWhenDone: exitWhenDone
|
||||
isSpec: true
|
||||
|
||||
|
||||
@@ -9,6 +9,8 @@ optimist = require 'optimist'
|
||||
nslog = require 'nslog'
|
||||
_ = require 'underscore'
|
||||
|
||||
global.homeDir = process.env[if process.platform is 'win32' then 'USERPROFILE' else 'HOME']
|
||||
|
||||
console.log = (args...) ->
|
||||
nslog(args.map((arg) -> JSON.stringify(arg)).join(" "))
|
||||
|
||||
@@ -35,9 +37,6 @@ delegate.browserMainParts.preMainMessageLoopRun = ->
|
||||
|
||||
AtomApplication.open(args)
|
||||
|
||||
getHomeDir = ->
|
||||
process.env[if process.platform is 'win32' then 'USERPROFILE' else 'HOME']
|
||||
|
||||
setupCrashReporter = ->
|
||||
crashReporter.setCompanyName 'GitHub'
|
||||
crashReporter.setSubmissionUrl 'https://speakeasy.githubapp.com/submit_crash_log'
|
||||
@@ -85,7 +84,7 @@ parseCommandLine = ->
|
||||
dev = true
|
||||
resourcePath = args['resource-path']
|
||||
else if dev
|
||||
resourcePath = path.join(getHomeDir(), 'github', 'atom')
|
||||
resourcePath = path.join(global.homeDir, 'github', 'atom')
|
||||
|
||||
try
|
||||
fs.statSync resourcePath
|
||||
|
||||
Reference in New Issue
Block a user