mirror of
https://github.com/ivabus/pantry
synced 2025-06-08 08:20:32 +03:00
set deduplication doesn't work, sadly, with SemVers.
Without this, .tar.gz and .tar.xz generate the same version line twice.
This commit is contained in:
parent
3d322f2701
commit
c84df235dc
1 changed files with 3 additions and 2 deletions
|
@ -95,11 +95,12 @@ async function get_versions(key: string, pkg: Package): Promise<SemVer[]> {
|
|||
.map(x => basename(x))
|
||||
.filter(x => x.match(/v.*\.tar\.gz$/))
|
||||
.map(x => x.replace(/v(.*)\.tar\.gz/, "$1"))
|
||||
.compact(semver.parse)
|
||||
?? []
|
||||
|
||||
// have to add pkg.version as put and get are not atomic
|
||||
return [...new Set([...got, pkg.version])].sort(semver.compare)
|
||||
return [...new Set([...got, pkg.version.toString()])]
|
||||
.compact(semver.parse)
|
||||
.sort(semver.compare)
|
||||
}
|
||||
|
||||
function assert_pkg(pkg: Package | PackageRequirement) {
|
||||
|
|
Loading…
Reference in a new issue