mirror of
https://github.com/webinstall/webi-installers.git
synced 2026-04-06 18:36:50 +00:00
fix(gittag): use HEAD-{date} format for tagless repos
Avoids HEAD date-versions (2024.06.08) sorting ahead of real semver tags (v1.2) since they measure different things.
This commit is contained in:
@@ -549,10 +549,10 @@ func classifyGitTag(pkg string, conf *installerconf.Conf, d *rawcache.Dir) ([]st
|
||||
filename = repoName + "-" + entry.GitTag
|
||||
} else if len(entry.Date) >= 19 {
|
||||
// Tagless repo (HEAD of master/main): synthesize a date-based
|
||||
// version like Node.js does: "2023.10.10-18.42.21"
|
||||
version = strings.ReplaceAll(entry.Date[:10], "-", ".") +
|
||||
"-" + strings.ReplaceAll(entry.Date[11:19], ":", ".")
|
||||
filename = repoName + "-v" + version
|
||||
// version prefixed with HEAD so it doesn't sort ahead of
|
||||
// real semver tags (e.g. HEAD-2023.10.10 vs v1.2).
|
||||
version = "HEAD-" + strings.ReplaceAll(entry.Date[:10], "-", ".")
|
||||
filename = repoName + "-" + version
|
||||
} else {
|
||||
continue
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user