fix: crash reproter arguments appeneded after '--' marker
Fixes https://github.com/microsoft/vscode/issues/108806
This commit is contained in:
parent
a9bbd0c09c
commit
bb16786cff
11
src/main.js
11
src/main.js
|
@ -79,7 +79,16 @@ if (crashReporterDirectory) {
|
|||
submitURL = submitURL.concat('&uid=', crashReporterId, '&iid=', crashReporterId, '&sid=', crashReporterId);
|
||||
// Send the id for child node process that are explicitly starting crash reporter.
|
||||
// For vscode this is ExtensionHost process currently.
|
||||
process.argv.push('--crash-reporter-id', crashReporterId);
|
||||
const argv = process.argv;
|
||||
const endOfArgsMarkerIndex = argv.indexOf('--');
|
||||
if (endOfArgsMarkerIndex === -1) {
|
||||
argv.push('--crash-reporter-id', crashReporterId);
|
||||
} else {
|
||||
// if the we have an argument "--" (end of argument marker)
|
||||
// we cannot add arguments at the end. rather, we add
|
||||
// arguments before the "--" marker.
|
||||
argv.splice(endOfArgsMarkerIndex, 0, '--crash-reporter-id', crashReporterId);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue