print success messages

This commit is contained in:
vilmibm 2020-12-09 17:31:34 -08:00
parent dbff17e6ed
commit 2248565839
3 changed files with 10 additions and 1 deletions

View file

@ -89,5 +89,10 @@ func removeRun(opts *RemoveOptions) error {
return fmt.Errorf("failed to delete secret %s: %w", opts.SecretName, err)
}
if opts.IO.IsStdoutTTY() {
cs := opts.IO.ColorScheme()
fmt.Fprintf(opts.IO.Out, "%s Removed secret %s\n", cs.SuccessIcon(), opts.SecretName)
}
return nil
}

View file

@ -23,7 +23,6 @@ func NewCmdSecret(f *cmdutil.Factory) *cobra.Command {
cmdutil.EnableRepoOverride(cmd, f)
cmd.AddCommand(cmdList.NewCmdList(f, nil))
// TODO add success messages to these:
cmd.AddCommand(cmdSet.NewCmdSet(f, nil))
cmd.AddCommand(cmdRemove.NewCmdRemove(f, nil))

View file

@ -163,6 +163,11 @@ func setRun(opts *SetOptions) error {
return fmt.Errorf("failed to set secret: %w", err)
}
if opts.IO.IsStdoutTTY() {
cs := opts.IO.ColorScheme()
fmt.Fprintf(opts.IO.Out, "%s Set secret %s\n", cs.SuccessIcon(), opts.SecretName)
}
return nil
}