mirror of
https://github.com/tailscale/tailscale.git
synced 2026-05-08 05:36:38 +02:00
version/mkversion: support tags ending in -pre
Updates #TODO Signed-off-by: James Tucker <james@tailscale.com>
This commit is contained in:
parent
7d5fe13d27
commit
50501f00a6
@ -190,7 +190,12 @@ func tailscaleModuleRef(modBs []byte) (string, error) {
|
||||
// Get the last - separated part of req.Mod.Version
|
||||
// (which is the git hash).
|
||||
if i := strings.LastIndexByte(req.Mod.Version, '-'); i != -1 {
|
||||
return req.Mod.Version[i+1:], nil
|
||||
// If the last part is "pre", the version is a pre-release.
|
||||
hashOrPre := req.Mod.Version[i+1:]
|
||||
if hashOrPre == "pre" {
|
||||
return req.Mod.Version, nil
|
||||
}
|
||||
return hashOrPre, nil
|
||||
}
|
||||
// If there are no dashes, the version is a tag.
|
||||
return req.Mod.Version, nil
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user