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:
AJ ONeal
2026-03-11 00:41:41 -06:00
parent d53f4ee16f
commit 44721b9aa8
2 changed files with 19 additions and 0 deletions

View File

@@ -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)
}

View 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, "_", ".")
}
}