From a061e185eec3bef685c0af9c7e8347ba47f1424a Mon Sep 17 00:00:00 2001 From: William Yardley Date: Thu, 4 May 2023 10:41:42 -0700 Subject: [PATCH] fix: use bold rather than backticks around command output Use `color` module to bold output of update command error Tests seem to pass despite not having control codes --- cmd/disabled.go | 4 +++- cmd/root_test.go | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/cmd/disabled.go b/cmd/disabled.go index 005572cbd..743b395ee 100644 --- a/cmd/disabled.go +++ b/cmd/disabled.go @@ -5,6 +5,7 @@ import ( "github.com/CircleCI-Public/circleci-cli/settings" "github.com/CircleCI-Public/circleci-cli/version" + "github.com/fatih/color" "github.com/spf13/cobra" ) @@ -39,7 +40,8 @@ func newDisabledCommand(config *settings.Config, command string) *cobra.Command } func disableCommand(opts disableOptions) { - fmt.Printf("`%s` is not available because this tool was installed using `%s`.\n", opts.command, version.PackageManager()) + bold := color.New(color.Bold).SprintFunc() + fmt.Printf("%s is not available because this tool was installed using %s.\n", bold(opts.command), bold(version.PackageManager())) if opts.command == "update" { fmt.Println("Please consult the package manager's documentation on how to update the CLI.") diff --git a/cmd/root_test.go b/cmd/root_test.go index def65ae10..c23982b18 100644 --- a/cmd/root_test.go +++ b/cmd/root_test.go @@ -64,7 +64,7 @@ var _ = Describe("Root", func() { Eventually(session.Err.Contents()).Should(BeEmpty()) - Eventually(session.Out).Should(gbytes.Say("`update` is not available because this tool was installed using `homebrew`.")) + Eventually(session.Out).Should(gbytes.Say("update is not available because this tool was installed using homebrew.")) Eventually(session.Out).Should(gbytes.Say("Please consult the package manager's documentation on how to update the CLI.")) Eventually(session).Should(gexec.Exit(0)) })