Skip to content

Commit 9f0bf08

Browse files
Adam WeberAkryum
authored andcommitted
fix: version check ignores cached version. fixes vuejs#1613 (vuejs#1614)
1 parent b1331ee commit 9f0bf08

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

packages/@vue/cli/lib/util/getVersions.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ module.exports = async function getVersions () {
1818
const lastChecked = (await fs.stat(fsCachePath)).mtimeMs
1919
const daysPassed = (Date.now() - lastChecked) / (60 * 60 * 1000 * 24)
2020
if (daysPassed > 7) {
21-
await getAndCacheLatestVersion(current)
21+
const cachedCurrent = await fs.readFile(fsCachePath, 'utf-8')
22+
await getAndCacheLatestVersion(cachedCurrent)
2223
}
2324
latest = await fs.readFile(fsCachePath, 'utf-8')
2425
} else {

0 commit comments

Comments
 (0)