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

Ensure application configuration is updated after fastly update #610

Merged
merged 1 commit into from
Jul 27, 2022
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions pkg/commands/update/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,15 @@ func (c *RootCommand) Exec(in io.Reader, out io.Writer) error {
}
}

file := c.Globals.File
err = file.Load(file.CLI.RemoteConfig, config.FilePath, c.Globals.HTTPClient)
if err != nil {
return errors.RemediationError{
Inner: fmt.Errorf("error updating the versioning information for the Fastly CLI: %w", err),
Remediation: errors.UpdateRemediation,
}
}

progress.Done()

text.Success(out, "Updated %s to %s.", currentPath, latest)
Expand Down
3 changes: 3 additions & 0 deletions pkg/errors/remediation_error.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,3 +154,6 @@ var ComputeTrialRemediation = "For more help with this error see fastly.help/cli

// ProfileRemediation suggests no profiles exist.
var ProfileRemediation = "Run `fastly profile create <NAME>` to create a profile, or `fastly profile list` to view available profiles (at least one profile should be set as 'default')."

// UpdateRemediation suggests no profiles exist.
var UpdateRemediation = "We'll attempt to update the Fastly CLI versioning information on the next invocation. If there are any errors, ensure `fastly config` matches https://developer.fastly.com/api/internal/cli-config"