mirror of
https://github.com/neilotoole/sq.git
synced 2024-12-01 03:14:02 +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:
|
||||
if latestVersion != "" && !strings.HasPrefix(latestVersion, "v") {
|
||||
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