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

pkg/compute/rust: update messaging for 'rustup self update' #281

Merged
merged 2 commits into from May 13, 2021
Merged
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
6 changes: 5 additions & 1 deletion pkg/compute/rust.go
Expand Up @@ -153,9 +153,13 @@ func (r Rust) Verify(out io.Writer) error {
return fmt.Errorf("error parsing rustup constraint: %w", err)
}
if !rustupConstraint.Check(rustupVersion) {
pre := "To fix this error, run the following command"
cmd := text.Bold("rustup self update")
alt := fmt.Sprintf("%s If you installed rustup using a package manager, you may need to follow your package manager's documentation to update the rustup package.", text.Bold("INFO:"))

return errors.RemediationError{
Inner: fmt.Errorf("rustup constraint not met: %s", r.config.File.Language.Rust.RustupConstraint),
Remediation: fmt.Sprintf("To fix this error, run the following command:\n\n\t$ %s\n", text.Bold("rustup self update")),
Remediation: fmt.Sprintf("%s:\n\n\t$ %s\n\n%s\n", pre, cmd, alt),
}
}

Expand Down