Make SonarCloud happier about our code quality (#632)

This commit is contained in:
Michael Telatynski 2023-04-26 15:05:58 +01:00 committed by GitHub
parent 7b0040063b
commit cd227a456a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -36,21 +36,25 @@ function checkSquirrelHooks(): boolean {
if (process.platform !== "win32") return false; if (process.platform !== "win32") return false;
const cmd = process.argv[1]; const cmd = process.argv[1];
const target = path.basename(process.execPath); const target = path.basename(process.execPath);
if (cmd === "--squirrel-install") {
switch (cmd) {
case "--squirrel-install":
runUpdateExe(["--createShortcut=" + target]).then(() => app.quit()); runUpdateExe(["--createShortcut=" + target]).then(() => app.quit());
return true; return true;
} else if (cmd === "--squirrel-updated") {
case "--squirrel-updated":
case "--squirrel-obsolete":
app.quit(); app.quit();
return true; return true;
} else if (cmd === "--squirrel-uninstall") {
case "--squirrel-uninstall":
runUpdateExe(["--removeShortcut=" + target]).then(() => app.quit()); runUpdateExe(["--removeShortcut=" + target]).then(() => app.quit());
return true; return true;
} else if (cmd === "--squirrel-obsolete") {
app.quit(); default:
return true;
}
return false; return false;
} }
}
if (checkSquirrelHooks()) { if (checkSquirrelHooks()) {
process.exit(1); process.exit(1);