|
@@ -7,17 +7,16 @@ Subject: refactor: alter child_process.fork to use execute script with
|
|
|
When forking a child script, we setup a special environment to make the Electron binary run like the upstream node. On Mac, we use the helper app as node binary.
|
|
|
|
|
|
diff --git a/lib/child_process.js b/lib/child_process.js
|
|
|
-index 66be7611dc958721aa67603396ac9dcc0b9737b0..8934a90f8d5c0557689eba80512802a38a8072ec 100644
|
|
|
+index 66be7611dc958721aa67603396ac9dcc0b9737b0..e489b75262928c5c3ff53676fc49e7005df43376 100644
|
|
|
--- a/lib/child_process.js
|
|
|
+++ b/lib/child_process.js
|
|
|
-@@ -102,6 +102,16 @@ function fork(modulePath /* , args, options */) {
|
|
|
+@@ -102,6 +102,15 @@ function fork(modulePath /* , args, options */) {
|
|
|
throw new ERR_CHILD_PROCESS_IPC_REQUIRED('options.stdio');
|
|
|
}
|
|
|
|
|
|
-+ if (!options.env) {
|
|
|
-+ options.env = Object.create(process.env);
|
|
|
-+ }
|
|
|
-+
|
|
|
++ // When forking a child script, we setup a special environment to make
|
|
|
++ // the electron binary run like upstream Node.js
|
|
|
++ options.env = Object.create(options.env || process.env)
|
|
|
+ options.env.ELECTRON_RUN_AS_NODE = 1;
|
|
|
+
|
|
|
+ if (!options.execPath && process.type && process.platform == 'darwin') {
|