@iola_adm/iola-cli 0.1.91 → 0.1.92
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/package.json +1 -1
- package/src/cli.js +13 -4
- package/test/smoke-test.js +5 -2
package/package.json
CHANGED
package/src/cli.js
CHANGED
|
@@ -2138,6 +2138,7 @@ async function handleUninstall(args = []) {
|
|
|
2138
2138
|
description: "локальная папка .iola текущего проекта",
|
|
2139
2139
|
});
|
|
2140
2140
|
}
|
|
2141
|
+
const npmPackage = "@iola_adm/iola-cli";
|
|
2141
2142
|
|
|
2142
2143
|
const safeTargets = targets.map((target) => ({
|
|
2143
2144
|
...target,
|
|
@@ -2160,7 +2161,8 @@ async function handleUninstall(args = []) {
|
|
|
2160
2161
|
exists: existsSync(target.path),
|
|
2161
2162
|
description: target.description,
|
|
2162
2163
|
})),
|
|
2163
|
-
|
|
2164
|
+
willRemovePackage: npmPackage,
|
|
2165
|
+
willKeep: ["Codex CLI", "Codex auth/config"],
|
|
2164
2166
|
reinstall: "npm install -g @iola_adm/iola-cli@latest",
|
|
2165
2167
|
};
|
|
2166
2168
|
if (options.json) printJson(payload);
|
|
@@ -2175,8 +2177,9 @@ async function handleUninstall(args = []) {
|
|
|
2175
2177
|
console.log(` ${target.description}`);
|
|
2176
2178
|
}
|
|
2177
2179
|
console.log("");
|
|
2180
|
+
console.log(`Будет удален npm-пакет: ${npmPackage}`);
|
|
2178
2181
|
console.log("Codex CLI и его настройки не удаляются.");
|
|
2179
|
-
const confirmed = await confirm("
|
|
2182
|
+
const confirmed = await confirm("Полностью удалить iola-cli? [y/N] ");
|
|
2180
2183
|
if (!confirmed) {
|
|
2181
2184
|
console.log("Удаление отменено.");
|
|
2182
2185
|
return { deleted: false };
|
|
@@ -2188,9 +2191,11 @@ async function handleUninstall(args = []) {
|
|
|
2188
2191
|
}
|
|
2189
2192
|
|
|
2190
2193
|
console.log("Локальные данные iola-cli удалены.");
|
|
2194
|
+
console.log(`Удаляю npm-пакет ${npmPackage}...`);
|
|
2195
|
+
await runCommand(getNpmCommand(), ["remove", "-g", npmPackage], { inherit: true });
|
|
2196
|
+
console.log("npm-пакет iola-cli удален.");
|
|
2191
2197
|
console.log("Codex CLI не тронут.");
|
|
2192
|
-
console.log("Для
|
|
2193
|
-
console.log(" npm remove -g @iola_adm/iola-cli");
|
|
2198
|
+
console.log("Для повторной установки:");
|
|
2194
2199
|
console.log(" npm install -g @iola_adm/iola-cli@latest");
|
|
2195
2200
|
return { deleted: true };
|
|
2196
2201
|
}
|
|
@@ -9986,6 +9991,10 @@ function runCommand(command, args, options = {}) {
|
|
|
9986
9991
|
});
|
|
9987
9992
|
}
|
|
9988
9993
|
|
|
9994
|
+
function getNpmCommand() {
|
|
9995
|
+
return process.platform === "win32" ? "npm.cmd" : "npm";
|
|
9996
|
+
}
|
|
9997
|
+
|
|
9989
9998
|
function debugLog(message) {
|
|
9990
9999
|
if (!process.env.IOLA_DEBUG_FILE) return;
|
|
9991
10000
|
appendFile(process.env.IOLA_DEBUG_FILE, `[${new Date().toISOString()}] ${message}\n`, "utf8").catch(() => {});
|
package/test/smoke-test.js
CHANGED
|
@@ -64,8 +64,11 @@ assertIncludes(skills, "reports", "skills list");
|
|
|
64
64
|
assertNotIncludes(skills, "gosuslugi", "skills list");
|
|
65
65
|
|
|
66
66
|
const deletePlan = JSON.parse(await runCli(["delete", "--dry-run", "--json"]));
|
|
67
|
-
if (!Array.isArray(deletePlan.willDelete) || !deletePlan.willKeep.includes("Codex CLI")) {
|
|
68
|
-
throw new Error("delete dry-run should list delete targets and keep Codex CLI");
|
|
67
|
+
if (!Array.isArray(deletePlan.willDelete) || deletePlan.willRemovePackage !== "@iola_adm/iola-cli" || !deletePlan.willKeep.includes("Codex CLI")) {
|
|
68
|
+
throw new Error("delete dry-run should list delete targets, npm package, and keep Codex CLI");
|
|
69
|
+
}
|
|
70
|
+
if (deletePlan.willKeep.includes("npm package files")) {
|
|
71
|
+
throw new Error("delete dry-run should not keep npm package files");
|
|
69
72
|
}
|
|
70
73
|
|
|
71
74
|
console.log("smoke tests passed");
|