From 006c77a00fb26572592af51e5201fc7a602e1e3c Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Tue, 8 Mar 2016 11:07:42 -0800 Subject: [PATCH] Update requires paths --- atom/common/node_bindings.cc | 1 - lib/browser/api/exports/electron.js | 2 +- lib/browser/init.js | 8 ++++---- lib/renderer/api/exports/electron.js | 2 +- lib/renderer/api/remote.js | 2 +- lib/renderer/init.js | 8 ++++---- 6 files changed, 11 insertions(+), 12 deletions(-) diff --git a/atom/common/node_bindings.cc b/atom/common/node_bindings.cc index 69e7906ffbbb..608cc94b09a0 100644 --- a/atom/common/node_bindings.cc +++ b/atom/common/node_bindings.cc @@ -165,7 +165,6 @@ node::Environment* NodeBindings::CreateEnvironment( base::FilePath script_path = resources_path.Append(FILE_PATH_LITERAL("atom.asar")) .Append(process_type) - .Append(FILE_PATH_LITERAL("lib")) .Append(FILE_PATH_LITERAL("init.js")); std::string script_path_str = script_path.AsUTF8Unsafe(); args.insert(args.begin() + 1, script_path_str.c_str()); diff --git a/lib/browser/api/exports/electron.js b/lib/browser/api/exports/electron.js index 7f97fcdbc4cf..ea9dd6eb5a26 100644 --- a/lib/browser/api/exports/electron.js +++ b/lib/browser/api/exports/electron.js @@ -1,4 +1,4 @@ -const common = require('../../../../common/api/lib/exports/electron'); +const common = require('../../../common/api/exports/electron'); // Import common modules. diff --git a/lib/browser/init.js b/lib/browser/init.js index 4769faee0a39..d6a18361d69d 100644 --- a/lib/browser/init.js +++ b/lib/browser/init.js @@ -11,19 +11,19 @@ var slice = [].slice; process.argv.splice(1, 1); // Clear search paths. -require(path.resolve(__dirname, '..', '..', 'common', 'lib', 'reset-search-paths')); +require(path.resolve(__dirname, '..', 'common', 'reset-search-paths')); // Import common settings. -require(path.resolve(__dirname, '..', '..', 'common', 'lib', 'init')); +require(path.resolve(__dirname, '..', 'common', 'init')); var globalPaths = Module.globalPaths; if (!process.env.ELECTRON_HIDE_INTERNAL_MODULES) { - globalPaths.push(path.resolve(__dirname, '..', 'api', 'lib')); + globalPaths.push(path.resolve(__dirname, 'api')); } // Expose public APIs. -globalPaths.push(path.resolve(__dirname, '..', 'api', 'lib', 'exports')); +globalPaths.push(path.resolve(__dirname, 'api', 'exports')); if (process.platform === 'win32') { // Redirect node's console to use our own implementations, since node can not diff --git a/lib/renderer/api/exports/electron.js b/lib/renderer/api/exports/electron.js index 3f0d3254cb8b..34a498fcc065 100644 --- a/lib/renderer/api/exports/electron.js +++ b/lib/renderer/api/exports/electron.js @@ -1,4 +1,4 @@ -const common = require('../../../../common/api/lib/exports/electron'); +const common = require('../../../common/api/exports/electron'); // Import common modules. common.defineProperties(exports); diff --git a/lib/renderer/api/remote.js b/lib/renderer/api/remote.js index 07aa24782935..42435d8304c6 100644 --- a/lib/renderer/api/remote.js +++ b/lib/renderer/api/remote.js @@ -244,7 +244,7 @@ ipcRenderer.on('ATOM_RENDERER_RELEASE_CALLBACK', function(event, id) { }); // List all built-in modules in browser process. -const browserModules = require('../../../browser/api/lib/exports/electron'); +const browserModules = require('../../browser/api/exports/electron'); // And add a helper receiver for each one. var fn = function(name) { diff --git a/lib/renderer/init.js b/lib/renderer/init.js index 166e64237de4..334aebda9cfe 100644 --- a/lib/renderer/init.js +++ b/lib/renderer/init.js @@ -9,19 +9,19 @@ const Module = require('module'); process.argv.splice(1, 1); // Clear search paths. -require(path.resolve(__dirname, '..', '..', 'common', 'lib', 'reset-search-paths')); +require(path.resolve(__dirname, '..', 'common', 'reset-search-paths')); // Import common settings. -require(path.resolve(__dirname, '..', '..', 'common', 'lib', 'init')); +require(path.resolve(__dirname, '..','common', 'init')); var globalPaths = Module.globalPaths; if (!process.env.ELECTRON_HIDE_INTERNAL_MODULES) { - globalPaths.push(path.resolve(__dirname, '..', 'api', 'lib')); + globalPaths.push(path.resolve(__dirname, 'api')); } // Expose public APIs. -globalPaths.push(path.resolve(__dirname, '..', 'api', 'lib', 'exports')); +globalPaths.push(path.resolve(__dirname, 'api', 'exports')); // The global variable will be used by ipc for event dispatching var v8Util = process.atomBinding('v8_util');