Do not rely on NODE_PATH env.

This commit is contained in:
Cheng Zhao
2014-03-18 15:34:24 +08:00
parent 344a56b47a
commit 87b95128f9
2 changed files with 3 additions and 8 deletions

View File

@@ -148,6 +148,9 @@ class Atom extends Model
{devMode, resourcePath} = @getLoadSettings()
configDirPath = @getConfigDirPath()
# Add 'src/exports' to module search path.
require('module').globalPaths.push(path.resolve(resourcePath, 'exports'))
@config = new Config({configDirPath, resourcePath})
@keymap = new Keymap({configDirPath, resourcePath})
@packages = new PackageManager({devMode, configDirPath, resourcePath})

View File

@@ -21,12 +21,7 @@ class AtomWindow
{@resourcePath, pathToOpen, initialLine, @isSpec, @exitWhenDone} = settings
global.atomApplication.addWindow(this)
@setupNodePath(@resourcePath)
@browserWindow = new BrowserWindow show: false, title: 'Atom', icon: @constructor.iconPath
@browserWindow.restart = _.wrap _.bind(@browserWindow.restart, @browserWindow), (restart) =>
@setupNodePath(@resourcePath)
restart()
@handleEvents()
loadSettings = _.extend({}, settings)
@@ -49,9 +44,6 @@ class AtomWindow
@openPath(pathToOpen, initialLine)
setupNodePath: (resourcePath) ->
process.env['NODE_PATH'] = path.resolve(resourcePath, 'exports')
getUrl: (loadSettingsObj) ->
# Ignore the windowState when passing loadSettings via URL, since it could
# be quite large.