mirror of
https://github.com/webinstall/webi-installers.git
synced 2026-04-06 18:36:50 +00:00
fix(postgres/psql): normalize REL_17_0 tag format to 17.0
Strip REL_ prefix and convert underscores to dots in a per-package normalizer rather than config, matching the convention for watchexec.
This commit is contained in:
@@ -32,6 +32,7 @@ import (
|
||||
"github.com/webinstall/webi-installers/internal/releases/node"
|
||||
"github.com/webinstall/webi-installers/internal/releases/ollama"
|
||||
"github.com/webinstall/webi-installers/internal/releases/pwsh"
|
||||
"github.com/webinstall/webi-installers/internal/releases/postgres"
|
||||
"github.com/webinstall/webi-installers/internal/releases/watchexec"
|
||||
"github.com/webinstall/webi-installers/internal/releases/xcaddy"
|
||||
"github.com/webinstall/webi-installers/internal/releases/zigdist"
|
||||
@@ -127,6 +128,8 @@ func NormalizeVersions(pkg string, assets []storage.Asset) {
|
||||
assets[i].Version = "0." + v[1:] + ".0"
|
||||
}
|
||||
}
|
||||
case "postgres", "psql":
|
||||
postgres.NormalizeVersions(assets)
|
||||
case "watchexec":
|
||||
watchexec.NormalizeVersions(assets)
|
||||
}
|
||||
|
||||
16
internal/releases/postgres/versions.go
Normal file
16
internal/releases/postgres/versions.go
Normal file
@@ -0,0 +1,16 @@
|
||||
package postgres
|
||||
|
||||
import (
|
||||
"strings"
|
||||
|
||||
"github.com/webinstall/webi-installers/internal/storage"
|
||||
)
|
||||
|
||||
// NormalizeVersions strips the REL_ prefix and converts underscores to dots.
|
||||
// GitHub tags are "REL_17_0" → version becomes "17.0".
|
||||
func NormalizeVersions(assets []storage.Asset) {
|
||||
for i := range assets {
|
||||
v := strings.TrimPrefix(assets[i].Version, "REL_")
|
||||
assets[i].Version = strings.ReplaceAll(v, "_", ".")
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user