mirror of
https://github.com/arduino/arduino-ide.git
synced 2025-07-08 11:56:36 +00:00
fix: propagate electron params in second instance startup (#2686)
This commit is contained in:
parent
e36f393682
commit
56ab874177
@ -385,10 +385,11 @@ export class ElectronMainApplication extends TheiaElectronMainApplication {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private async launchFromArgs(
|
private async launchFromArgs(
|
||||||
params: ElectronMainCommandOptions
|
params: ElectronMainCommandOptions,
|
||||||
|
argv?: string[]
|
||||||
): Promise<boolean> {
|
): Promise<boolean> {
|
||||||
// Copy to prevent manipulation of original array
|
// Copy to prevent manipulation of original array
|
||||||
const argCopy = [...this.argv];
|
const argCopy = [...(argv || this.argv)];
|
||||||
let path: string | undefined;
|
let path: string | undefined;
|
||||||
for (const maybePath of argCopy) {
|
for (const maybePath of argCopy) {
|
||||||
const resolvedPath = await this.resolvePath(maybePath, params.cwd);
|
const resolvedPath = await this.resolvePath(maybePath, params.cwd);
|
||||||
@ -526,7 +527,7 @@ export class ElectronMainApplication extends TheiaElectronMainApplication {
|
|||||||
argv: string[],
|
argv: string[],
|
||||||
cwd: string
|
cwd: string
|
||||||
): Promise<void> {
|
): Promise<void> {
|
||||||
if (await this.launchFromArgs({ cwd, secondInstance: true })) {
|
if (await this.launchFromArgs({ cwd, secondInstance: true }, argv)) {
|
||||||
// Application has received a file in its arguments
|
// Application has received a file in its arguments
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user