Use process.resourcePath to locate js files.
This commit is contained in:
parent
72f74d7c0d
commit
3cd910abc6
3 changed files with 10 additions and 10 deletions
|
@ -16,13 +16,13 @@ atom.browserMainParts =
|
||||||
# implement various logics.
|
# implement various logics.
|
||||||
global.__atom = atom
|
global.__atom = atom
|
||||||
|
|
||||||
# Add Atom.app/Contents/Resources/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 = require('module').globalPaths
|
||||||
globalPaths.push path.join(__dirname, '..', 'api', 'lib')
|
globalPaths.push path.join process.resourcesPath, 'browser', 'api', 'lib'
|
||||||
|
|
||||||
# And Atom.app/Contents/Resources/common/api/lib
|
# And also common/api/lib
|
||||||
globalPaths.push path.join(__dirname, '..', '..', 'common', 'api', 'lib')
|
globalPaths.push path.join process.resourcesPath, 'common', 'api', 'lib'
|
||||||
|
|
||||||
# Don't quit on fatal error.
|
# Don't quit on fatal error.
|
||||||
process.on 'uncaughtException', (error) ->
|
process.on 'uncaughtException', (error) ->
|
||||||
|
@ -41,13 +41,13 @@ require './rpc-server.js'
|
||||||
# Now we try to load app's package.json.
|
# Now we try to load app's package.json.
|
||||||
packageJson = null
|
packageJson = null
|
||||||
|
|
||||||
packagePath = path.join __dirname, '..', '..', 'app'
|
packagePath = path.join process.resourcesPath, 'app'
|
||||||
try
|
try
|
||||||
# First we try to load Atom.app/Contents/Resources/app
|
# First we try to load process.resourcesPath/app
|
||||||
packageJson = JSON.parse(fs.readFileSync(path.join(packagePath, 'package.json')))
|
packageJson = JSON.parse(fs.readFileSync(path.join(packagePath, 'package.json')))
|
||||||
catch error
|
catch error
|
||||||
# If not found then we load Atom.app/Contents/Resources/browser/default_app
|
# If not found then we load browser/default_app
|
||||||
packagePath = path.join __dirname, '..', 'default_app'
|
packagePath = path.join process.resourcesPath, 'browser', 'default_app'
|
||||||
packageJson = JSON.parse(fs.readFileSync(path.join(packagePath, 'package.json')))
|
packageJson = JSON.parse(fs.readFileSync(path.join(packagePath, 'package.json')))
|
||||||
|
|
||||||
# Finally load app's main.js and transfer control to C++.
|
# Finally load app's main.js and transfer control to C++.
|
||||||
|
|
2
vendor/brightray
vendored
2
vendor/brightray
vendored
|
@ -1 +1 @@
|
||||||
Subproject commit a0cd47fe130303710ac5323c520589962311fabd
|
Subproject commit 0805ba501cc9e9c4bf1cf1e265a782c53b2cc45f
|
2
vendor/node
vendored
2
vendor/node
vendored
|
@ -1 +1 @@
|
||||||
Subproject commit 49cb96d841e3499fb5b1355eca679a0c238fb8e3
|
Subproject commit ac5244fcaad0f28f92d2db84c57c1c9b2de7ecb2
|
Loading…
Add table
Add a link
Reference in a new issue