mirror of
https://github.com/AikidoSec/safe-chain.git
synced 2026-05-26 12:10:49 +00:00
Code quality: use early return
This commit is contained in:
parent
8b189443b7
commit
4a90bd2621
1 changed files with 9 additions and 8 deletions
|
|
@ -82,16 +82,17 @@ async function uninstallIfInstalled() {
|
|||
|
||||
const productCode = result.stdout.trim();
|
||||
|
||||
if (productCode) {
|
||||
ui.writeInformation("🗑️ Removing previous installation...");
|
||||
ui.writeVerbose(`Found product code: ${productCode}`);
|
||||
ui.writeVerbose(`Running: msiexec /x ${productCode} /qn /norestart`);
|
||||
await safeSpawn("msiexec", ["/x", productCode, "/qn", "/norestart"], {
|
||||
stdio: "inherit",
|
||||
});
|
||||
} else {
|
||||
if (!productCode) {
|
||||
ui.writeVerbose("No existing installation found (fresh install).");
|
||||
return;
|
||||
}
|
||||
|
||||
ui.writeInformation("🗑️ Removing previous installation...");
|
||||
ui.writeVerbose(`Found product code: ${productCode}`);
|
||||
ui.writeVerbose(`Running: msiexec /x ${productCode} /qn /norestart`);
|
||||
await safeSpawn("msiexec", ["/x", productCode, "/qn", "/norestart"], {
|
||||
stdio: "inherit",
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue