Skip to content

Commit

Permalink
converst msg to warning
Browse files Browse the repository at this point in the history
  • Loading branch information
mattjperez committed Feb 14, 2024
1 parent 357204b commit fb40338
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions cli/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -400,8 +400,6 @@ func CheckUpdate(c *cli.Context) error {
return nil
}

infof(c.App.ErrWriter, "checking if update available")

dateCompiledRaw := rconfig.DateCompiled
dateCompiled, err := time.Parse("2006-01-02", dateCompiledRaw)
if err != nil {
Expand All @@ -426,17 +424,13 @@ func CheckUpdate(c *cli.Context) error {
return err
}

// get latest release version

ctx := context.Background()
req, err := http.NewRequestWithContext(ctx, http.MethodGet, releaseURL, nil)
if err != nil {
return err
}
client := http.DefaultClient

infof(c.App.ErrWriter, "checking latest release")

client := http.DefaultClient
res, err := client.Do(req)
if err != nil {
return err
Expand All @@ -458,7 +452,7 @@ func CheckUpdate(c *cli.Context) error {
}

if v1.LessThan(v2) {
infof(c.App.ErrWriter, "Your version of Viam CLI is out of date. Version %s available", resp.TagName)
warningf(c.App.ErrWriter, "Your version of Viam CLI is out of date. Version %s available", resp.TagName)
}

return nil
Expand Down

0 comments on commit fb40338

Please sign in to comment.