@kud/soap-cli 3.0.15 → 3.0.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +21 -18
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -196,9 +196,9 @@ var getComputerName = () => {
|
|
|
196
196
|
};
|
|
197
197
|
var getBundleIdentifier = async (appName) => {
|
|
198
198
|
try {
|
|
199
|
-
const bundleId = execSync(
|
|
200
|
-
|
|
201
|
-
).toString();
|
|
199
|
+
const bundleId = execSync(`osascript -e 'id of app "${appName}"'`, {
|
|
200
|
+
stdio: "pipe"
|
|
201
|
+
}).toString();
|
|
202
202
|
return bundleId.trimEnd();
|
|
203
203
|
} catch {
|
|
204
204
|
throw new Error(
|
|
@@ -247,7 +247,7 @@ var param = rawArgs.find((a) => !a.startsWith("-"));
|
|
|
247
247
|
var yes = rawArgs.includes("--yes") || rawArgs.includes("-y");
|
|
248
248
|
var yesDangerously = rawArgs.includes("--yes-dangerously");
|
|
249
249
|
if (firstArg === "--version" || firstArg === "-v") {
|
|
250
|
-
console.log("3.0.
|
|
250
|
+
console.log("3.0.17");
|
|
251
251
|
process.exit(0);
|
|
252
252
|
}
|
|
253
253
|
if (!firstArg || firstArg === "--help" || firstArg === "-h") {
|
|
@@ -312,7 +312,7 @@ try {
|
|
|
312
312
|
signale.warn(
|
|
313
313
|
`Could not determine app name for "${param}", falling back to brew uninstall.`
|
|
314
314
|
);
|
|
315
|
-
await $2`brew uninstall --zap ${param}`;
|
|
315
|
+
await $2({ quiet: true })`brew uninstall --zap ${param}`;
|
|
316
316
|
process.exit(0);
|
|
317
317
|
}
|
|
318
318
|
signale.error(`Could not determine app name for "${param}".`);
|
|
@@ -426,7 +426,7 @@ Can you become an admin before we proceed?`,
|
|
|
426
426
|
}
|
|
427
427
|
console.log("");
|
|
428
428
|
signale.pending("Running Homebrew uninstall\u2026");
|
|
429
|
-
await $2`brew uninstall --zap ${param}`;
|
|
429
|
+
await $2({ quiet: true })`brew uninstall --zap ${param}`;
|
|
430
430
|
const brewPrefix = (await $2`brew --prefix`).stdout.trim();
|
|
431
431
|
const caskroomEntry = `${brewPrefix}/Caskroom/${param}`;
|
|
432
432
|
try {
|
|
@@ -441,7 +441,8 @@ Can you become an admin before we proceed?`,
|
|
|
441
441
|
console.log("");
|
|
442
442
|
signale.success("Done.");
|
|
443
443
|
} catch (error) {
|
|
444
|
-
const
|
|
444
|
+
const rawMessage = error instanceof Error ? error.message : "An unexpected error occurred.";
|
|
445
|
+
const message = rawMessage.split("\n").filter((l) => !/^\s+at /.test(l) && !/exit code:/.test(l)).join("\n").trim();
|
|
445
446
|
const isPermissionError = message.includes("sudoers") || message.includes("Permission denied");
|
|
446
447
|
const isCaskNotInstalled = message.includes("is not installed");
|
|
447
448
|
console.log("");
|
|
@@ -462,18 +463,8 @@ Force-run ${chalk.bold(`brew uninstall --zap --force ${param}`)}?`,
|
|
|
462
463
|
if (forceUninstall) {
|
|
463
464
|
console.log("");
|
|
464
465
|
signale.pending("Force-uninstalling cask\u2026");
|
|
465
|
-
await $2`brew uninstall --zap --force ${param}`;
|
|
466
|
+
await $2({ quiet: true })`brew uninstall --zap --force ${param}`;
|
|
466
467
|
signale.success("Force uninstall complete.");
|
|
467
|
-
const brewPrefix = (await $2`brew --prefix`).stdout.trim();
|
|
468
|
-
const caskroomEntry = `${brewPrefix}/Caskroom/${param}`;
|
|
469
|
-
try {
|
|
470
|
-
await fs2.access(caskroomEntry);
|
|
471
|
-
await trash(caskroomEntry);
|
|
472
|
-
signale.success(
|
|
473
|
-
`Removed leftover Caskroom entry: ${chalk.dim(caskroomEntry)}`
|
|
474
|
-
);
|
|
475
|
-
} catch {
|
|
476
|
-
}
|
|
477
468
|
}
|
|
478
469
|
} else if (isCask && isPermissionError) {
|
|
479
470
|
signale.info(
|
|
@@ -484,4 +475,16 @@ Force-run ${chalk.bold(`brew uninstall --zap --force ${param}`)}?`,
|
|
|
484
475
|
`Cask "${param}" is not registered in Homebrew \u2014 skipping brew uninstall.`
|
|
485
476
|
);
|
|
486
477
|
}
|
|
478
|
+
if (isCask) {
|
|
479
|
+
const brewPrefix = (await $2`brew --prefix`).stdout.trim();
|
|
480
|
+
const caskroomEntry = `${brewPrefix}/Caskroom/${param}`;
|
|
481
|
+
try {
|
|
482
|
+
await fs2.access(caskroomEntry);
|
|
483
|
+
await trash(caskroomEntry);
|
|
484
|
+
signale.success(
|
|
485
|
+
`Removed leftover Caskroom entry: ${chalk.dim(caskroomEntry)}`
|
|
486
|
+
);
|
|
487
|
+
} catch {
|
|
488
|
+
}
|
|
489
|
+
}
|
|
487
490
|
}
|