@jairodri/huckleberry-cli 1.0.1 → 1.0.2

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/package.json +1 -1
  2. package/src/cli.js +9 -7
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jairodri/huckleberry-cli",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "description": "Huckleberry AI System — One-click sovereign AI installer",
5
5
  "type": "module",
6
6
  "bin": {
package/src/cli.js CHANGED
@@ -8,16 +8,18 @@ const __dirname = dirname(fileURLToPath(import.meta.url));
8
8
  const ROOT = join(__dirname, "..");
9
9
  const PACKAGE_ROOT = ROOT;
10
10
 
11
- const VERSION = JSON.parse(
11
+ const PKG = JSON.parse(
12
12
  readFileSync(join(PACKAGE_ROOT, "package.json"), "utf-8")
13
- ).version;
13
+ );
14
+ const VERSION = PKG.version;
15
+ const PKG_NAME = PKG.name;
14
16
 
15
- const commands = { install, update, "install-pack": installPack, interview: runInterview, help, version: () => console.log(`@huckleberry/cli v${VERSION}`) };
17
+ const commands = { install, update, "install-pack": installPack, interview: runInterview, help, version: () => console.log(`${PKG_NAME} v${VERSION}`) };
16
18
 
17
19
  export async function run(args) {
18
20
  const cmd = args[0];
19
21
  if (!cmd || cmd === "--help" || cmd === "-h") return help();
20
- if (cmd === "--version" || cmd === "-v") return console.log(`@huckleberry/cli v${VERSION}`);
22
+ if (cmd === "--version" || cmd === "-v") return console.log(`${PKG_NAME} v${VERSION}`);
21
23
  const handler = commands[cmd];
22
24
  if (!handler) {
23
25
  console.error(`Unknown command: ${cmd}\nRun 'huckleberry help' for usage.`);
@@ -171,10 +173,10 @@ async function install() {
171
173
  async function update() {
172
174
  console.log(`\n Updating Huckleberry...\n`);
173
175
  try {
174
- execSync("npm update -g @huckleberry/cli", { stdio: "inherit" });
175
- console.log(` ✓ @huckleberry/cli updated`);
176
+ execSync(`npm update -g ${PKG_NAME}`, { stdio: "inherit" });
177
+ console.log(` ✓ ${PKG_NAME} updated`);
176
178
  } catch {
177
- console.error(` ⚠ @huckleberry/cli update failed`);
179
+ console.error(` ⚠ ${PKG_NAME} update failed. Try: npm install -g ${PKG_NAME}@latest\n`);
178
180
  }
179
181
 
180
182
  // Update Inkstone independently