@myapihq/cli 1.0.67 → 1.0.68
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/commands/update.js +5 -6
- package/package.json +1 -1
package/dist/commands/update.js
CHANGED
|
@@ -19,8 +19,10 @@ export async function checkForUpdate(currentVersion) {
|
|
|
19
19
|
if (latest && isNewer(latest, currentVersion)) {
|
|
20
20
|
info(`\n› New version available (${currentVersion} → ${latest}) — installing…`);
|
|
21
21
|
try {
|
|
22
|
-
//
|
|
23
|
-
|
|
22
|
+
// Use @latest so npm only resolves to a fully-published tarball, avoiding
|
|
23
|
+
// ETARGET races where registry metadata briefly reports a version before
|
|
24
|
+
// its tarball is available.
|
|
25
|
+
execSync(`"${npmBin()}" install -g @myapihq/cli@latest`, { stdio: 'pipe' });
|
|
24
26
|
const config = loadConfig();
|
|
25
27
|
if (config?.skills_installed) {
|
|
26
28
|
await installSkills();
|
|
@@ -29,11 +31,8 @@ export async function checkForUpdate(currentVersion) {
|
|
|
29
31
|
}
|
|
30
32
|
catch (installErr) {
|
|
31
33
|
const msg = installErr?.stderr?.toString?.() || installErr?.message || String(installErr);
|
|
32
|
-
// Silently ignore ETARGET — version just published, tarball not yet available.
|
|
33
|
-
if (msg.includes('ETARGET') || msg.includes('notarget'))
|
|
34
|
-
return;
|
|
35
34
|
info(`› Auto-update failed: ${msg.trim()}`);
|
|
36
|
-
info(`› Run manually: npm install -g @myapihq/cli
|
|
35
|
+
info(`› Run manually: npm install -g @myapihq/cli@latest`);
|
|
37
36
|
}
|
|
38
37
|
}
|
|
39
38
|
}
|