@vizamodo/viza-cli 1.2.14 → 1.2.17
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/src/core/version.js +6 -1
- package/package.json +1 -1
package/dist/src/core/version.js
CHANGED
|
@@ -108,7 +108,12 @@ export async function checkForCliUpdateSoft() {
|
|
|
108
108
|
if (existsSync(cachePath)) {
|
|
109
109
|
const raw = readFileSync(cachePath, "utf8");
|
|
110
110
|
const cached = JSON.parse(raw);
|
|
111
|
-
if
|
|
111
|
+
// Invalidate cache if CLI version has changed since last check
|
|
112
|
+
const curNow = getCliVersion();
|
|
113
|
+
if (cached.current && cached.current !== curNow) {
|
|
114
|
+
// ignore stale cache
|
|
115
|
+
}
|
|
116
|
+
else if (cached.checkedAt && (now - cached.checkedAt) < ttl) {
|
|
112
117
|
return cached;
|
|
113
118
|
}
|
|
114
119
|
}
|