d78f37ec8f
Co-authored-by: Milan Burda <miburda@microsoft.com>
22 lines
544 B
JavaScript
22 lines
544 B
JavaScript
const { app, utilityProcess } = require('electron');
|
|
const path = require('node:path');
|
|
|
|
app.whenReady().then(() => {
|
|
let child = null;
|
|
if (app.commandLine.hasSwitch('create-custom-env')) {
|
|
child = utilityProcess.fork(path.join(__dirname, 'test.js'), {
|
|
env: {
|
|
FROM: 'child'
|
|
}
|
|
});
|
|
} else {
|
|
child = utilityProcess.fork(path.join(__dirname, 'test.js'));
|
|
}
|
|
child.on('message', (data) => {
|
|
process.stdout.write(data);
|
|
process.stdout.end();
|
|
});
|
|
child.on('exit', () => {
|
|
app.quit();
|
|
});
|
|
});
|