go pseudo version hack script: update main

- use correct default major version
- Warn (but do not fail) if no version tag exists yet.
This commit is contained in:
Malte Poll 2022-08-02 10:49:00 +02:00 committed by Malte Poll
parent f9dc21685f
commit 6a84bb5b4b

View File

@ -13,7 +13,7 @@ import (
)
func main() {
major := flag.String("major", "v1", "Optional major version")
major := flag.String("major", "v0", "Optional major version")
base := flag.String("base", "", "Optional base version")
revisionTimestamp := flag.String("time", "", "Optional revision time")
revision := flag.String("revision", "", "Optional revision (git commit hash)")
@ -29,7 +29,8 @@ func main() {
if *base == "" {
_, versionTag, err := gitc.FirstParentWithVersionTag()
if err != nil {
log.With(zap.Error(err)).Fatalf("Failed to find base version")
log.With(zap.Error(err)).Warnf("Failed to find base version. Using default.")
versionTag = ""
}
*base = versionTag
}