Skip to content

Commit

Permalink
Support new version string format
Browse files Browse the repository at this point in the history
  • Loading branch information
wizeguyy committed Jan 31, 2023
1 parent 3baaca4 commit c93e700
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.1.0-pre.0
v0.1.0-pre.0
5 changes: 4 additions & 1 deletion params/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ func readVersionFile() (version, error) {
if err != nil {
panic(err)
}
if raw[0] != 'v' {
return version{}, errors.New("version number must start with 'v'")
}
full := strings.Replace(string(raw), "\n", "", -1)
// Take a full version string, e.g. 0.0.0-rc.0
// and split it into the version number and version metadata (if it has meta).
Expand All @@ -58,7 +61,7 @@ func readVersionFile() (version, error) {
if len(vnums) != 3 {
return version{}, errors.New("bad version number format")
}
major, err := strconv.Atoi(string(vnums[0][:]))
major, err := strconv.Atoi(string(vnums[1][:])) // First byte is 'v'
if err != nil {
return version{}, err
}
Expand Down

0 comments on commit c93e700

Please sign in to comment.