@kud/soap-cli 3.0.4 → 3.0.6

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 +16 -19
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -239,18 +239,15 @@ var findAppFiles = async (appName, bundleId) => {
239
239
  // index.ts
240
240
  $2.verbose = process.env.SOAP_DEBUG === "1";
241
241
  var rawArgs = process.argv.slice(2);
242
+ var firstArg = rawArgs[0];
242
243
  var param = rawArgs.find((a) => !a.startsWith("-"));
243
244
  var yes = rawArgs.includes("--yes") || rawArgs.includes("-y");
244
- var isFlag = param?.startsWith("-");
245
- if (!param || param === "--help" || param === "-h" || param === "--version" || param === "-v" || isFlag && param !== "--help" && param !== "-h") {
246
- if (param === "--version" || param === "-v") {
247
- const { createRequire } = await import("module");
248
- const require2 = createRequire(import.meta.url);
249
- const { version } = require2("./package.json");
250
- console.log(`soap v${version}`);
251
- process.exit(0);
252
- }
253
- if (param === "--help" || param === "-h") {
245
+ if (firstArg === "--version" || firstArg === "-v") {
246
+ console.log("3.0.6");
247
+ process.exit(0);
248
+ }
249
+ if (!firstArg || firstArg === "--help" || firstArg === "-h") {
250
+ if (firstArg === "--help" || firstArg === "-h") {
254
251
  console.log(`
255
252
  ${chalk.bold("soap")} \u{1F9FC} ${chalk.italic("the app cleaner")}
256
253
 
@@ -280,15 +277,15 @@ if (!param || param === "--help" || param === "-h" || param === "--version" || p
280
277
  `);
281
278
  process.exit(0);
282
279
  }
283
- if (isFlag) {
284
- console.error(
285
- chalk.red(`Unknown option: ${param}. Run \`soap --help\` for usage.`)
286
- );
287
- } else {
288
- console.error(
289
- chalk.red("No parameter specified. Run `soap --help` for usage.")
290
- );
291
- }
280
+ console.error(
281
+ chalk.red("No parameter specified. Run `soap --help` for usage.")
282
+ );
283
+ process.exit(1);
284
+ }
285
+ if (!param) {
286
+ console.error(
287
+ chalk.red(`Unknown option: ${firstArg}. Run \`soap --help\` for usage.`)
288
+ );
292
289
  process.exit(1);
293
290
  }
294
291
  var isCask = !param.includes(".app");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kud/soap-cli",
3
- "version": "3.0.4",
3
+ "version": "3.0.6",
4
4
  "description": "An app cleaner cli for macOS",
5
5
  "main": "dist/index.js",
6
6
  "bin": {