Skip to content

Commit 2b1f9a0

Browse files
committed
Fix generated snapshot format
Was not properly zero-padded
1 parent 6030ea3 commit 2b1f9a0

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

changelog.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# Changelog
22

3+
## Next
4+
- Fixed snapshots being incorrectly formatted in the output of `--list`.
5+
36
## 1.3.10
47
*2024-01-01*
58
- Updated resource and data pack formats to `18`.

src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ function getVersions(format: number, type: PackType = 'resource'): VersionsResul
149149
const minIndex = snapIndices[0]
150150
const maxIndex = snapIndices[snapIndices.length - 1]
151151
const maxSnap = startSnaps[minIndex][0]
152-
const minSnap = startSnaps[maxIndex + 1][0].replace(/(\d+)\w$/, (_, n) => `${n - 1}a`)
152+
const minSnap = startSnaps[maxIndex + 1][0].replace(/(\d+)\w$/, (_, n) => `${(n - 1).toString().padStart(2, '0')}a`)
153153
output.snapshots.min = maxSnap as SnapshotName
154154
output.snapshots.max = minSnap as SnapshotName
155155
}

0 commit comments

Comments
 (0)