mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
fix: app.relaunch loses args when execPath specified (#35253)
fix: app.relaunch loses args when execPath specified (#35108) Co-authored-by: Aaron Meriwether <me@ameriwether.com>
This commit is contained in:
10
spec/fixtures/api/relaunch/main.js
vendored
10
spec/fixtures/api/relaunch/main.js
vendored
@@ -11,11 +11,15 @@ app.whenReady().then(() => {
|
||||
const lastArg = process.argv[process.argv.length - 1];
|
||||
const client = net.connect(socketPath);
|
||||
client.once('connect', () => {
|
||||
client.end(String(lastArg === '--second'));
|
||||
client.end(lastArg);
|
||||
});
|
||||
client.once('end', () => {
|
||||
if (lastArg !== '--second') {
|
||||
app.relaunch({ args: process.argv.slice(1).concat('--second') });
|
||||
if (lastArg === '--first') {
|
||||
// Once without execPath specified
|
||||
app.relaunch({ args: process.argv.slice(1, -1).concat('--second') });
|
||||
} else if (lastArg === '--second') {
|
||||
// And once with execPath specified
|
||||
app.relaunch({ execPath: process.argv[0], args: process.argv.slice(1, -1).concat('--third') });
|
||||
}
|
||||
app.exit(0);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user