@kendoo.agentdesk/agentdesk 0.11.0 → 0.11.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/agentdesk.mjs +10 -3
- package/package.json +1 -1
package/bin/agentdesk.mjs
CHANGED
|
@@ -181,10 +181,17 @@ else if (command === "daemon") {
|
|
|
181
181
|
|
|
182
182
|
else if (command === "update") {
|
|
183
183
|
const { execSync } = await import("child_process");
|
|
184
|
-
|
|
184
|
+
const currentVersion = pkg.version;
|
|
185
|
+
console.log(`\n Current version: ${currentVersion}`);
|
|
185
186
|
try {
|
|
186
|
-
execSync(`npm
|
|
187
|
-
|
|
187
|
+
const latest = execSync(`npm view ${pkg.name} version`, { encoding: "utf-8" }).trim();
|
|
188
|
+
if (latest === currentVersion) {
|
|
189
|
+
console.log(` Already up to date.\n`);
|
|
190
|
+
} else {
|
|
191
|
+
console.log(` Updating to ${latest}...\n`);
|
|
192
|
+
execSync(`npm i -g ${pkg.name}@latest`, { stdio: "inherit" });
|
|
193
|
+
console.log(`\n Updated: ${currentVersion} → ${latest}\n`);
|
|
194
|
+
}
|
|
188
195
|
} catch {
|
|
189
196
|
console.error(`\n Update failed. Try manually: npm i -g ${pkg.name}@latest\n`);
|
|
190
197
|
process.exit(1);
|