Skip to content

Commit 0b2ffbf

Browse files
committed
fix: sort cache keys, remove default 10
1 parent 86da819 commit 0b2ffbf

File tree

3 files changed

+15
-4
lines changed

3 files changed

+15
-4
lines changed

cli-cache.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"v11": "f7da341322c2f860156e8144b208583596504479",
3-
"v9": "64763a341e7aa5b456e696f956759bf9b3440dc1",
42
"v8": "aa8fff11cdab94fff1a2160ee5241f5f4632e96b",
5-
"v10": "a3041941586b6fb8ed7403fe3c24d81138a96005"
3+
"v9": "64763a341e7aa5b456e696f956759bf9b3440dc1",
4+
"v10": "a3041941586b6fb8ed7403fe3c24d81138a96005",
5+
"v11": "f7da341322c2f860156e8144b208583596504479"
66
}

cli/lib/cache.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,17 @@ class CacheVersionSha {
1212
}
1313

1414
async save() {
15+
const sortedCache = {}
16+
Object.keys(this.cache)
17+
.sort((a, b) => {
18+
const numA = parseInt(a.replace('v', ''), 10)
19+
const numB = parseInt(b.replace('v', ''), 10)
20+
return numA - numB
21+
})
22+
.forEach(key => {
23+
sortedCache[key] = this.cache[key]
24+
})
25+
this.cache = sortedCache
1526
await fs.writeFile(this.path, JSON.stringify(this.cache, null, 2))
1627
return this
1728
}

content/nav.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1327,7 +1327,7 @@
13271327
- title: Version 10.9.2
13281328
shortName: v10
13291329
url: /cli/v10
1330-
default: true
1330+
default: false
13311331
type: legacy
13321332
children:
13331333
- title: CLI Commands

0 commit comments

Comments
 (0)