Skip to content

Commit

Permalink
Merge pull request #461 from sgerrand/homebrew-bump-updated-json-version
Browse files Browse the repository at this point in the history
Bump JSON version for brew outdated
  • Loading branch information
aengelberg authored Sep 9, 2020
2 parents a8361bf + 0f1d136 commit b58303d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions update/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,17 +70,17 @@ func checkFromHomebrew(check *Options) error {
return errors.Wrap(err, "Expected to find `brew` in your $PATH but wasn't able to find it")
}

command := exec.Command(brew, "outdated", "--json=v1") // #nosec
command := exec.Command(brew, "outdated", "--json=v2") // #nosec
out, err := command.Output()
if err != nil {
return errors.Wrap(err, "failed to check for updates. `brew outdated --json=v1` returned an error")
return errors.Wrap(err, "failed to check for updates. `brew outdated --json=v2` returned an error")
}

var outdated HomebrewOutdated

err = json.Unmarshal(out, &outdated)
if err != nil {
return errors.Wrap(err, "failed to parse output of `brew outdated --json=v1`")
return errors.Wrap(err, "failed to parse output of `brew outdated --json=v2`")
}

for _, o := range outdated {
Expand All @@ -101,7 +101,7 @@ func checkFromHomebrew(check *Options) error {
return nil
}

// HomebrewOutdated wraps the JSON output from running `brew outdated --json=v1`
// HomebrewOutdated wraps the JSON output from running `brew outdated --json=v2`
// We're specifically looking for this kind of structured data from the command:
//
// [
Expand Down

0 comments on commit b58303d

Please sign in to comment.