@kud/soap-cli 3.0.1 → 3.0.3

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.
Files changed (2) hide show
  1. package/dist/index.js +19 -5
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -238,7 +238,9 @@ var findAppFiles = async (appName, bundleId) => {
238
238
 
239
239
  // index.ts
240
240
  $2.verbose = process.env.SOAP_DEBUG === "1";
241
- var [param] = process.argv.slice(2);
241
+ var rawArgs = process.argv.slice(2);
242
+ var param = rawArgs.find((a) => !a.startsWith("-"));
243
+ var yes = rawArgs.includes("--yes") || rawArgs.includes("-y");
242
244
  var isFlag = param?.startsWith("-");
243
245
  if (!param || param === "--help" || param === "-h" || param === "--version" || param === "-v" || isFlag && param !== "--help" && param !== "-h") {
244
246
  if (param === "--version" || param === "-v") {
@@ -260,6 +262,7 @@ if (!param || param === "--help" || param === "-h" || param === "--version" || p
260
262
  soap ${chalk.green("android-studio")} Uninstall Android Studio (cask)
261
263
  soap ${chalk.green("/Applications/Slack.app")}
262
264
  Uninstall Slack by path (no brew step)
265
+ soap ${chalk.green("spotify")} ${chalk.cyan("--yes")} Non-interactive: move all files + run brew uninstall
263
266
 
264
267
  ${chalk.bold("What it removes:")}
265
268
  ${chalk.dim("\xB7")} The .app bundle ${chalk.dim("(via brew uninstall --zap or manual selection)")}
@@ -269,6 +272,9 @@ if (!param || param === "--help" || param === "-h" || param === "--version" || p
269
272
  ${chalk.dim("\xB7")} Containers ${chalk.dim("~/Library/Containers/com.<vendor>.<app>")}
270
273
  ${chalk.dim("\xB7")} Launch agents, logs, crash reports, DMG files, and more
271
274
 
275
+ ${chalk.bold("Flags:")}
276
+ ${chalk.cyan("--yes")}, ${chalk.cyan("-y")} Skip all prompts (auto-select all files, auto-confirm brew uninstall)
277
+
272
278
  ${chalk.bold("Environment:")}
273
279
  ${chalk.yellow("SOAP_DEBUG=1")} Enable verbose shell output
274
280
  `);
@@ -286,14 +292,22 @@ if (!param || param === "--help" || param === "-h" || param === "--version" || p
286
292
  process.exit(1);
287
293
  }
288
294
  var isCask = !param.includes(".app");
289
- console.log(
290
- `
295
+ if (!yes)
296
+ console.log(
297
+ `
291
298
  Welcome to ${chalk.bold("soap")} \u{1F9FC}, ${chalk.italic("the app cleaner")}.
292
299
  `
293
- );
300
+ );
294
301
  try {
295
302
  const { appName, zapFiles } = isCask ? await spinner(chalk.dim("Fetching cask info\u2026"), () => getCaskInfo(param)) : { appName: appNameFromPath(param), zapFiles: [] };
296
303
  if (!appName) {
304
+ if (isCask) {
305
+ signale.warn(
306
+ `Could not determine app name for "${param}", falling back to brew uninstall.`
307
+ );
308
+ await $2`brew uninstall --zap ${param}`;
309
+ process.exit(0);
310
+ }
297
311
  signale.error(`Could not determine app name for "${param}".`);
298
312
  process.exit(1);
299
313
  }
@@ -314,7 +328,7 @@ try {
314
328
  isCask ? `Mode: ${chalk.bold("cask")} (${param})` : `Mode: ${chalk.bold("path")} \u2014 no Homebrew uninstall will run`
315
329
  );
316
330
  console.log("");
317
- const { deletedFilesWish, deletedCaskWish } = await inquirer.prompt([
331
+ const { deletedFilesWish, deletedCaskWish } = yes ? { deletedFilesWish: appFiles, deletedCaskWish: isCask } : await inquirer.prompt([
318
332
  {
319
333
  type: "checkbox",
320
334
  name: "deletedFilesWish",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kud/soap-cli",
3
- "version": "3.0.1",
3
+ "version": "3.0.3",
4
4
  "description": "An app cleaner cli for macOS",
5
5
  "main": "dist/index.js",
6
6
  "bin": {