Remove duplication of locating Atom Home

This commit is contained in:
Dave Rael
2015-10-20 07:34:18 -06:00
committed by Kevin Sawicki
parent de7cf162f9
commit 5d5d83d474
4 changed files with 25 additions and 38 deletions

View File

@@ -19,7 +19,7 @@
// Ensure ATOM_HOME is always set before anything else is required
// This is because of a difference in Linux not inherited between browser and render processes
// issue #5142
setupAtomHome()
setupAtomHome(loadSettings.atomHome)
blobStore = FileSystemBlobStore.load(
path.join(process.env.ATOM_HOME, 'blob-store/')
@@ -69,7 +69,7 @@
function setupWindow (loadSettings) {
var CompileCache = require('../src/compile-cache')
CompileCache.setAtomHomeDirectory(process.env.ATOM_HOME)
CompileCache.setAtomHomeDirectory(loadSettings.atomHome)
var ModuleCache = require('../src/module-cache')
ModuleCache.register(loadSettings)
@@ -92,22 +92,8 @@
require('ipc').sendChannel('window-command', 'window:loaded')
}
function setupAtomHome () {
if (!process.env.ATOM_HOME) {
var home
if (process.platform === 'win32') {
home = process.env.USERPROFILE
} else {
home = process.env.HOME
}
var atomHome = path.join(home, '.atom')
try {
atomHome = fs.realpathSync(atomHome)
} catch (error) {
// Ignore since the path might just not exist yet.
}
process.env.ATOM_HOME = atomHome
}
function setupAtomHome (atomHome) {
process.env.ATOM_HOME = atomHome
}
function setupCsonCache (cacheDir) {