blun-king-cli 7.2.3 → 7.2.4
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/bin/blun.js +23 -0
- package/package.json +1 -1
package/bin/blun.js
CHANGED
|
@@ -12,6 +12,28 @@ async function main() {
|
|
|
12
12
|
const workspace = require("../lib/workspace");
|
|
13
13
|
|
|
14
14
|
switch (command) {
|
|
15
|
+
case "update":
|
|
16
|
+
case "upgrade": {
|
|
17
|
+
const { execSync } = require("child_process");
|
|
18
|
+
const chalk = require("chalk");
|
|
19
|
+
console.log(chalk.cyan("\n Checking for updates..."));
|
|
20
|
+
try {
|
|
21
|
+
const latest = execSync("npm view blun-king-cli version", { encoding: "utf8" }).trim();
|
|
22
|
+
if (latest === pkg.version) {
|
|
23
|
+
console.log(chalk.green(" Already on latest version: v" + pkg.version + "\n"));
|
|
24
|
+
} else {
|
|
25
|
+
console.log(chalk.yellow(" Updating v" + pkg.version + " → v" + latest + "..."));
|
|
26
|
+
execSync("npm install -g blun-king-cli@latest", { stdio: "inherit" });
|
|
27
|
+
console.log(chalk.green("\n Updated to v" + latest + "!\n"));
|
|
28
|
+
}
|
|
29
|
+
} catch (e) {
|
|
30
|
+
console.error(chalk.red(" Update failed: " + e.message));
|
|
31
|
+
console.log(chalk.dim(" Try: npm install -g blun-king-cli@latest\n"));
|
|
32
|
+
process.exit(1);
|
|
33
|
+
}
|
|
34
|
+
break;
|
|
35
|
+
}
|
|
36
|
+
|
|
15
37
|
case "version":
|
|
16
38
|
case "--version":
|
|
17
39
|
case "-v":
|
|
@@ -36,6 +58,7 @@ async function main() {
|
|
|
36
58
|
"blun settings Show/change settings",
|
|
37
59
|
"blun status Show system health",
|
|
38
60
|
"blun init Initialize BLUN project in current dir",
|
|
61
|
+
"blun update Self-update to latest version",
|
|
39
62
|
"blun version Show version",
|
|
40
63
|
"blun help Show this help"
|
|
41
64
|
].join("\n"), "cyan");
|