Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ignore brew errors #614

Merged
merged 1 commit into from Feb 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions cmd/meroxa/builder/builder.go
Expand Up @@ -503,8 +503,8 @@ func buildCommandAutoUpdate(cmd *cobra.Command) {

github.Client = &http.Client{}
latestCLIVersion, err := github.GetLatestCLITag(cmd.Context())
if err != nil {
return err
if err != nil || latestCLIVersion == "" {
return nil
}

if global.Version != latestCLIVersion {
Expand Down
6 changes: 5 additions & 1 deletion cmd/meroxa/github/github.go
Expand Up @@ -73,7 +73,11 @@ func getContentHomebrewFormula(ctx context.Context) (string, error) {
// and extracts its version number.
func parseVersionFromFormulaFile(content string) string {
r := regexp.MustCompile(`version "(\d+.\d+.\d+)"`)
return r.FindStringSubmatch(content)[1]
matches := r.FindStringSubmatch(content)
if len(matches) >= 2 { //nolint:gomnd
return matches[1]
}
return ""
}

// GetLatestCLITag fetches the content formula file from GitHub and then parses its version.
Expand Down