@0dai-dev/cli 3.1.8 → 3.1.9
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/0dai.js +6 -2
- package/package.json +1 -1
package/bin/0dai.js
CHANGED
|
@@ -1386,8 +1386,12 @@ async function checkVersion() {
|
|
|
1386
1386
|
|
|
1387
1387
|
const result = await apiCall("/v1/version");
|
|
1388
1388
|
if (result.version && result.version !== VERSION) {
|
|
1389
|
-
|
|
1390
|
-
|
|
1389
|
+
// Only suggest update if remote version is actually newer
|
|
1390
|
+
const cmp = (a, b) => { const [a1,a2,a3] = a.split(".").map(Number); const [b1,b2,b3] = b.split(".").map(Number); return a1 - b1 || a2 - b2 || a3 - b3; };
|
|
1391
|
+
if (cmp(result.version, VERSION) > 0) {
|
|
1392
|
+
log(`Update available: ${VERSION} → ${result.version}`);
|
|
1393
|
+
console.log(` Run: npm update -g @0dai-dev/cli\n`);
|
|
1394
|
+
}
|
|
1391
1395
|
}
|
|
1392
1396
|
} catch {}
|
|
1393
1397
|
}
|