Update Makefile

This commit is contained in:
世界
2023-08-27 21:14:10 +08:00
parent 5a309266f0
commit e7b35be5f6
7 changed files with 220 additions and 10 deletions

View File

@@ -21,3 +21,12 @@ func ReadTag() (string, error) {
}
return version.String() + "-" + shortCommit, nil
}
func ReadTagVersion() (string, error) {
currentTagRev, err := shell.Exec("git", "describe", "--tags", "--abbrev=0").ReadOutput()
if err != nil {
return "", err
}
version := badversion.Parse(currentTagRev[1:])
return version.VersionString(), nil
}