From 92ccd5fa1d34ec443e1b7ced3e8ae6575b8c0784 Mon Sep 17 00:00:00 2001 From: Adrien Delorme Date: Thu, 4 Feb 2021 11:11:42 +0100 Subject: [PATCH] init: show successful installs in cyan (#10557) --- command/init.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/command/init.go b/command/init.go index 4bc617efd..0ee48fb32 100644 --- a/command/init.go +++ b/command/init.go @@ -9,6 +9,7 @@ import ( "strings" pluginsdk "github.com/hashicorp/packer-plugin-sdk/plugin" + "github.com/hashicorp/packer/packer" plugingetter "github.com/hashicorp/packer/packer/plugin-getter" "github.com/hashicorp/packer/packer/plugin-getter/github" "github.com/hashicorp/packer/version" @@ -94,6 +95,11 @@ func (c *InitCommand) RunContext(buildCtx context.Context, cla *InitArgs) int { }, } + ui := &packer.ColoredUi{ + Color: packer.UiColorCyan, + Ui: c.Ui, + } + for _, pluginRequirement := range reqs { // Get installed plugins that match requirement @@ -119,7 +125,7 @@ func (c *InitCommand) RunContext(buildCtx context.Context, cla *InitArgs) int { } if newInstall != nil { msg := fmt.Sprintf("Installed plugin %s %s in %q", pluginRequirement.Identifier.ForDisplay(), newInstall.Version, newInstall.BinaryPath) - c.Ui.Say(msg) + ui.Say(msg) } } return ret