mirror of
https://github.com/neilotoole/sq.git
synced 2024-11-28 12:33:44 +03:00
More error checking in cmd_version
This commit is contained in:
parent
66a8c39844
commit
19aa8c76ff
@ -55,6 +55,9 @@ func execVersion(cmd *cobra.Command, args []string) error {
|
|||||||
case latestVersion = <-resultCh:
|
case latestVersion = <-resultCh:
|
||||||
if latestVersion != "" && !strings.HasPrefix(latestVersion, "v") {
|
if latestVersion != "" && !strings.HasPrefix(latestVersion, "v") {
|
||||||
latestVersion = "v" + latestVersion
|
latestVersion = "v" + latestVersion
|
||||||
|
if !semver.IsValid(latestVersion) {
|
||||||
|
return errz.Errorf("invalid semver from brew repo: {%s}", latestVersion)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user