wispy-cli 2.2.0 → 2.2.1
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/wispy.mjs +22 -0
- package/package.json +1 -1
package/bin/wispy.mjs
CHANGED
|
@@ -116,6 +116,28 @@ if (args[0] === "setup" || args[0] === "init") {
|
|
|
116
116
|
process.exit(0);
|
|
117
117
|
}
|
|
118
118
|
|
|
119
|
+
// ── update sub-command ────────────────────────────────────────────────────────
|
|
120
|
+
if (args[0] === "update") {
|
|
121
|
+
const { execSync } = await import("node:child_process");
|
|
122
|
+
console.log("🌿 Checking for updates...");
|
|
123
|
+
try {
|
|
124
|
+
const current = JSON.parse(await import("node:fs").then(f => f.readFileSync(path.join(__dirname, "..", "package.json"), "utf8"))).version;
|
|
125
|
+
const latest = execSync("npm info wispy-cli version", { encoding: "utf8" }).trim();
|
|
126
|
+
if (current === latest) {
|
|
127
|
+
console.log(`✅ Already on latest version (${current})`);
|
|
128
|
+
} else {
|
|
129
|
+
console.log(`📦 ${current} → ${latest}`);
|
|
130
|
+
console.log("Updating...");
|
|
131
|
+
execSync("npm install -g wispy-cli@latest", { stdio: "inherit" });
|
|
132
|
+
console.log(`\n✅ Updated to ${latest}`);
|
|
133
|
+
}
|
|
134
|
+
} catch (e) {
|
|
135
|
+
console.error(`❌ Update failed: ${e.message}`);
|
|
136
|
+
process.exit(1);
|
|
137
|
+
}
|
|
138
|
+
process.exit(0);
|
|
139
|
+
}
|
|
140
|
+
|
|
119
141
|
// ── status sub-command ────────────────────────────────────────────────────────
|
|
120
142
|
if (args[0] === "status") {
|
|
121
143
|
// Try the enhanced status from onboarding.mjs first
|