@novastorm-ai/cli 0.0.8 → 0.0.9
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/bin/nova.js
CHANGED
|
@@ -939,13 +939,13 @@ async function startCommand() {
|
|
|
939
939
|
if (config.telemetry.enabled && process.env["NOVA_TELEMETRY"] !== "false") {
|
|
940
940
|
const { createHash: createHash2 } = await import("crypto");
|
|
941
941
|
const os = await import("os");
|
|
942
|
-
const { execFile:
|
|
942
|
+
const { execFile: execFile4 } = await import("child_process");
|
|
943
943
|
const mac = Object.values(os.networkInterfaces()).flat().find((i) => !i?.internal && i?.mac !== "00:00:00:00:00:00")?.mac ?? "";
|
|
944
944
|
const machineId = createHash2("sha256").update(os.hostname() + os.userInfo().username + mac).digest("hex");
|
|
945
945
|
let projectHash;
|
|
946
946
|
try {
|
|
947
947
|
const remoteUrl = await new Promise((resolve4, reject) => {
|
|
948
|
-
|
|
948
|
+
execFile4("git", ["remote", "get-url", "origin"], { cwd }, (err, stdout3) => {
|
|
949
949
|
if (err) reject(err);
|
|
950
950
|
else resolve4(stdout3.trim());
|
|
951
951
|
});
|
|
@@ -955,7 +955,7 @@ async function startCommand() {
|
|
|
955
955
|
projectHash = createHash2("sha256").update(cwd).digest("hex");
|
|
956
956
|
}
|
|
957
957
|
const telemetry = new Telemetry();
|
|
958
|
-
const cliPkg = await import("./package-
|
|
958
|
+
const cliPkg = await import("./package-RIMA2PN2.js").catch(
|
|
959
959
|
() => ({ default: { version: "0.0.1" } })
|
|
960
960
|
);
|
|
961
961
|
telemetry.send({
|
|
@@ -2148,6 +2148,40 @@ async function checkForUpdates(currentVersion) {
|
|
|
2148
2148
|
}
|
|
2149
2149
|
}
|
|
2150
2150
|
|
|
2151
|
+
// src/commands/uninstall.ts
|
|
2152
|
+
import { execFile as execFile3 } from "child_process";
|
|
2153
|
+
import chalk11 from "chalk";
|
|
2154
|
+
import ora4 from "ora";
|
|
2155
|
+
var PKG_NAME2 = "@novastorm-ai/cli";
|
|
2156
|
+
function runCommand(cmd, args) {
|
|
2157
|
+
return new Promise((resolve4) => {
|
|
2158
|
+
execFile3(cmd, args, { timeout: 3e4 }, (error, stdout3, stderr) => {
|
|
2159
|
+
if (error) {
|
|
2160
|
+
resolve4({ ok: false, output: stderr || error.message });
|
|
2161
|
+
} else {
|
|
2162
|
+
resolve4({ ok: true, output: stdout3 });
|
|
2163
|
+
}
|
|
2164
|
+
});
|
|
2165
|
+
});
|
|
2166
|
+
}
|
|
2167
|
+
async function uninstallCommand() {
|
|
2168
|
+
const spinner = ora4("Uninstalling Novastorm CLI...").start();
|
|
2169
|
+
let result = await runCommand("npm", ["uninstall", "-g", PKG_NAME2]);
|
|
2170
|
+
if (!result.ok) {
|
|
2171
|
+
result = await runCommand("pnpm", ["uninstall", "-g", PKG_NAME2]);
|
|
2172
|
+
}
|
|
2173
|
+
if (result.ok) {
|
|
2174
|
+
spinner.succeed("Novastorm CLI uninstalled.");
|
|
2175
|
+
console.log(chalk11.gray("\n Thanks for trying Novastorm."));
|
|
2176
|
+
console.log(chalk11.gray(` Feedback? ${chalk11.cyan("https://github.com/novastorm-cli/nova/issues")}`));
|
|
2177
|
+
console.log(chalk11.gray(` Come back anytime: ${chalk11.cyan(`npm install -g ${PKG_NAME2}`)}
|
|
2178
|
+
`));
|
|
2179
|
+
} else {
|
|
2180
|
+
spinner.fail("Uninstall failed. Try manually:");
|
|
2181
|
+
console.log(chalk11.cyan(` npm uninstall -g ${PKG_NAME2}`));
|
|
2182
|
+
}
|
|
2183
|
+
}
|
|
2184
|
+
|
|
2151
2185
|
// src/index.ts
|
|
2152
2186
|
var __dirname = dirname(fileURLToPath(import.meta.url));
|
|
2153
2187
|
var pkg = JSON.parse(
|
|
@@ -2211,6 +2245,9 @@ function createCli() {
|
|
|
2211
2245
|
program.command("update").description("Update Novastorm CLI to the latest version").action(async () => {
|
|
2212
2246
|
await updateCommand();
|
|
2213
2247
|
});
|
|
2248
|
+
program.command("uninstall").description("Uninstall Novastorm CLI from your system").action(async () => {
|
|
2249
|
+
await uninstallCommand();
|
|
2250
|
+
});
|
|
2214
2251
|
return program;
|
|
2215
2252
|
}
|
|
2216
2253
|
var BANNER = `\x1B[96m
|
package/dist/index.js
CHANGED