@kud/soap-cli 3.0.11 → 3.0.13
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 +11 -4
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -173,15 +173,17 @@ var resolveZapPaths = async (caskData) => {
|
|
|
173
173
|
var getCaskInfo = async (caskName) => {
|
|
174
174
|
try {
|
|
175
175
|
const caskData = await fetchCaskData(caskName);
|
|
176
|
+
const renamedTo = caskData.token !== caskName ? caskData.token : null;
|
|
176
177
|
let appName = null;
|
|
177
178
|
for (const artifact of caskData.artifacts) {
|
|
178
179
|
if (artifact.app) {
|
|
179
|
-
|
|
180
|
+
const raw = artifact.app[0] || null;
|
|
181
|
+
appName = raw ? raw.replace(/\.app$/i, "") : null;
|
|
180
182
|
break;
|
|
181
183
|
}
|
|
182
184
|
}
|
|
183
185
|
const zapFiles = await resolveZapPaths(caskData);
|
|
184
|
-
return { appName, zapFiles };
|
|
186
|
+
return { appName, zapFiles, renamedTo };
|
|
185
187
|
} catch (error) {
|
|
186
188
|
throw new Error(
|
|
187
189
|
`Failed to get cask info for "${caskName}": ${error instanceof Error ? error.message : String(error)}`
|
|
@@ -244,7 +246,7 @@ var param = rawArgs.find((a) => !a.startsWith("-"));
|
|
|
244
246
|
var yes = rawArgs.includes("--yes") || rawArgs.includes("-y");
|
|
245
247
|
var yesDangerously = rawArgs.includes("--yes-dangerously");
|
|
246
248
|
if (firstArg === "--version" || firstArg === "-v") {
|
|
247
|
-
console.log("3.0.
|
|
249
|
+
console.log("3.0.13");
|
|
248
250
|
process.exit(0);
|
|
249
251
|
}
|
|
250
252
|
if (!firstArg || firstArg === "--help" || firstArg === "-h") {
|
|
@@ -298,7 +300,12 @@ Welcome to ${chalk.bold("soap")} \u{1F9FC}, ${chalk.italic("the app cleaner")}.
|
|
|
298
300
|
`
|
|
299
301
|
);
|
|
300
302
|
try {
|
|
301
|
-
const { appName, zapFiles } = isCask ? await spinner(chalk.dim("Fetching cask info\u2026"), () => getCaskInfo(param)) : { appName: appNameFromPath(param), zapFiles: [] };
|
|
303
|
+
const { appName, zapFiles, renamedTo } = isCask ? await spinner(chalk.dim("Fetching cask info\u2026"), () => getCaskInfo(param)) : { appName: appNameFromPath(param), zapFiles: [], renamedTo: null };
|
|
304
|
+
if (renamedTo) {
|
|
305
|
+
signale.warn(
|
|
306
|
+
`Cask "${param}" has been renamed to "${chalk.bold(renamedTo)}". Files will be cleaned using the new name.`
|
|
307
|
+
);
|
|
308
|
+
}
|
|
302
309
|
if (!appName) {
|
|
303
310
|
if (isCask) {
|
|
304
311
|
signale.warn(
|