Add global.homeDir

Ick, this should be handled by an npm or hopefully a patch to Node.
This commit is contained in:
probablycorey
2013-06-14 09:56:01 -07:00
parent da58bd5609
commit 3ba7d68d4a
2 changed files with 4 additions and 5 deletions

View File

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

View File

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