Set process.mainModule to user's app.
This commit is contained in:
parent
41b9add5d6
commit
48224a6455
1 changed files with 6 additions and 5 deletions
|
@ -1,6 +1,7 @@
|
||||||
fs = require 'fs'
|
fs = require 'fs'
|
||||||
path = require 'path'
|
path = require 'path'
|
||||||
util = require 'util'
|
module = require 'module'
|
||||||
|
util = require 'util'
|
||||||
|
|
||||||
# Expose information of current process.
|
# Expose information of current process.
|
||||||
process.type = 'browser'
|
process.type = 'browser'
|
||||||
|
@ -17,7 +18,7 @@ process.execArgv = process.argv.splice startMark, endMark - startMark + 1
|
||||||
|
|
||||||
# Add browser/api/lib to require's search paths,
|
# Add browser/api/lib to require's search paths,
|
||||||
# which contains javascript part of Atom's built-in libraries.
|
# which contains javascript part of Atom's built-in libraries.
|
||||||
globalPaths = require('module').globalPaths
|
globalPaths = module.globalPaths
|
||||||
globalPaths.push path.join process.resourcesPath, 'atom', 'browser', 'api', 'lib'
|
globalPaths.push path.join process.resourcesPath, 'atom', 'browser', 'api', 'lib'
|
||||||
|
|
||||||
# Do loading in next tick since we still need some initialize work before
|
# Do loading in next tick since we still need some initialize work before
|
||||||
|
@ -77,4 +78,4 @@ setImmediate ->
|
||||||
app.setName packageJson.name
|
app.setName packageJson.name
|
||||||
|
|
||||||
# Finally load app's main.js and transfer control to C++.
|
# Finally load app's main.js and transfer control to C++.
|
||||||
require path.join(packagePath, packageJson.main)
|
module._load path.join(packagePath, packageJson.main), module, true
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue