mirror of
https://github.com/webinstall/webi-installers.git
synced 2026-04-07 02:46:50 +00:00
ref(watchexec): move cli- prefix stripping from config to code
The cli- prefix is a watchexec-specific monorepo artifact, not a generic config concern. Move it to internal/releases/watchexec/versions.go alongside other per-package normalizers (git, lf).
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/watchexec"
|
||||
"github.com/webinstall/webi-installers/internal/releases/xcaddy"
|
||||
"github.com/webinstall/webi-installers/internal/releases/zigdist"
|
||||
"github.com/webinstall/webi-installers/internal/storage"
|
||||
@@ -100,6 +101,8 @@ func NormalizeVersions(pkg string, assets []storage.Asset) {
|
||||
assets[i].Version = "0." + v[1:] + ".0"
|
||||
}
|
||||
}
|
||||
case "watchexec":
|
||||
watchexec.NormalizeVersions(assets)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
18
internal/releases/watchexec/versions.go
Normal file
18
internal/releases/watchexec/versions.go
Normal file
@@ -0,0 +1,18 @@
|
||||
package watchexec
|
||||
|
||||
import (
|
||||
"strings"
|
||||
|
||||
"github.com/webinstall/webi-installers/internal/storage"
|
||||
)
|
||||
|
||||
// NormalizeVersions strips the "cli-" prefix from watchexec version strings.
|
||||
//
|
||||
// Watchexec transitioned to a monorepo with cli-prefixed tags (cli-v1.20.0)
|
||||
// while older releases used plain tags (v1.20.6). Both are valid releases;
|
||||
// the prefix is just a tag namespace, not part of the version.
|
||||
func NormalizeVersions(assets []storage.Asset) {
|
||||
for i := range assets {
|
||||
assets[i].Version = strings.TrimPrefix(assets[i].Version, "cli-")
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,3 @@
|
||||
source = github
|
||||
owner = watchexec
|
||||
repo = watchexec
|
||||
version_prefixes = cli-
|
||||
|
||||
Reference in New Issue
Block a user