Skip to content

Commit

Permalink
fix: use bold rather than backticks around command output
Browse files Browse the repository at this point in the history
Use `color` module to bold output of update command error
Tests seem to pass despite not having control codes
  • Loading branch information
wyardley committed May 4, 2023
1 parent 2259641 commit a061e18
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion cmd/disabled.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)

Expand Down Expand Up @@ -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.")
Expand Down
2 changes: 1 addition & 1 deletion cmd/root_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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))
})
Expand Down

0 comments on commit a061e18

Please sign in to comment.