Fix process.resourcesPath.

This commit is contained in:
Cheng Zhao 2014-03-16 13:24:25 +08:00
parent 6285e26972
commit 5dd5f18edf
5 changed files with 10 additions and 9 deletions

View file

@ -290,7 +290,7 @@
], ],
}, },
{ {
'destination': '<(PRODUCT_DIR)/<(product_name).app/Contents/Resources/browser', 'destination': '<(PRODUCT_DIR)/<(product_name).app/Contents/Resources/atom/browser',
'files': [ 'files': [
'atom/browser/default_app', 'atom/browser/default_app',
], ],
@ -328,7 +328,7 @@
], ],
}, },
{ {
'destination': '<(PRODUCT_DIR)/resources/browser', 'destination': '<(PRODUCT_DIR)/resources/atom/browser',
'files': [ 'files': [
'atom/browser/default_app', 'atom/browser/default_app',
] ]
@ -346,7 +346,7 @@
], ],
}, },
{ {
'destination': '<(PRODUCT_DIR)/resources/browser', 'destination': '<(PRODUCT_DIR)/resources/atom/browser',
'files': [ 'files': [
'atom/browser/default_app', 'atom/browser/default_app',
] ]

View file

@ -4,7 +4,7 @@ util = require 'util'
# Expose information of current process. # Expose information of current process.
process.__atom_type = 'browser' process.__atom_type = 'browser'
process.resourcesPath = path.resolve process.argv[1], '..', '..', '..' process.resourcesPath = path.resolve process.argv[1], '..', '..', '..', '..'
# We modified the original process.argv to let node.js load the atom.js, # We modified the original process.argv to let node.js load the atom.js,
# we need to restore it here. # we need to restore it here.
@ -18,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 = require('module').globalPaths
globalPaths.push path.join process.resourcesPath, '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
# native bindings can work. # native bindings can work.

View file

@ -4,7 +4,7 @@ Module = require 'module'
# Add common/api/lib to module search paths. # Add common/api/lib to module search paths.
globalPaths = Module.globalPaths globalPaths = Module.globalPaths
globalPaths.push path.join(process.resourcesPath, 'common', 'api', 'lib') globalPaths.push path.join(process.resourcesPath, 'atom', 'common', 'api', 'lib')
# setImmediate and process.nextTick makes use of uv_check and uv_prepare to # setImmediate and process.nextTick makes use of uv_check and uv_prepare to
# run the callbacks, however since we only run uv loop on requests, the # run the callbacks, however since we only run uv loop on requests, the

View file

@ -125,7 +125,8 @@ node::Environment* NodeBindings::CreateEnvironment(
exec_path.DirName().AppendASCII("resources"); exec_path.DirName().AppendASCII("resources");
#endif #endif
base::FilePath script_path = base::FilePath script_path =
resources_path.AppendASCII(is_browser_ ? "browser" : "renderer") resources_path.AppendASCII("atom")
.AppendASCII(is_browser_ ? "browser" : "renderer")
.AppendASCII("lib") .AppendASCII("lib")
.AppendASCII("init.js"); .AppendASCII("init.js");
std::string script_path_str = script_path.AsUTF8Unsafe(); std::string script_path_str = script_path.AsUTF8Unsafe();

View file

@ -3,7 +3,7 @@ Module = require 'module'
# Expose information of current process. # Expose information of current process.
process.__atom_type = 'renderer' process.__atom_type = 'renderer'
process.resourcesPath = path.resolve process.argv[1], '..', '..', '..' process.resourcesPath = path.resolve process.argv[1], '..', '..', '..', '..'
# We modified the original process.argv to let node.js load the # We modified the original process.argv to let node.js load the
# atom-renderer.js, we need to restore it here. # atom-renderer.js, we need to restore it here.
@ -12,7 +12,7 @@ process.argv.splice 1, 1
# Add renderer/api/lib to require's search paths, which contains javascript part # Add renderer/api/lib to require's search paths, which contains javascript part
# of Atom's built-in libraries. # of Atom's built-in libraries.
globalPaths = Module.globalPaths globalPaths = Module.globalPaths
globalPaths.push path.join(process.resourcesPath, 'renderer', 'api', 'lib') globalPaths.push path.join(process.resourcesPath, 'atom', 'renderer', 'api', 'lib')
# And also app. # And also app.
globalPaths.push path.join(process.resourcesPath, 'app') globalPaths.push path.join(process.resourcesPath, 'app')