From 940d5d98a0207a2d3b940307c7c308faecbb8a18 Mon Sep 17 00:00:00 2001 From: Mark McDonnell Date: Thu, 13 May 2021 12:21:54 +0100 Subject: [PATCH 1/2] pkg/compute/rust: update messaging for 'rustup self update' Fixes #269 --- pkg/compute/rust.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkg/compute/rust.go b/pkg/compute/rust.go index a4a091eaf..9c7503a4b 100644 --- a/pkg/compute/rust.go +++ b/pkg/compute/rust.go @@ -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, refer to its documentation to update it.", 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), } } From 717bea0447367de8721b907b0c2b78572ab539fc Mon Sep 17 00:00:00 2001 From: Mark McDonnell Date: Thu, 13 May 2021 13:51:39 +0100 Subject: [PATCH 2/2] Update pkg/compute/rust.go Co-authored-by: Andrew Betts --- pkg/compute/rust.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/compute/rust.go b/pkg/compute/rust.go index 9c7503a4b..4852c9ba4 100644 --- a/pkg/compute/rust.go +++ b/pkg/compute/rust.go @@ -155,7 +155,7 @@ func (r Rust) Verify(out io.Writer) error { 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, refer to its documentation to update it.", text.Bold("INFO:")) + 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),