Add confirmation to extensions remove

This commit is contained in:
Sam Coe 2021-07-01 10:43:41 -07:00
parent a6710ec506
commit 86f2df1f49
No known key found for this signature in database
GPG key ID: 8E322C20F811D086
2 changed files with 7 additions and 1 deletions

View file

@ -121,7 +121,12 @@ func NewCmdExtensions(f *cmdutil.Factory) *cobra.Command {
Short: "Remove an installed extension",
Args: cobra.ExactArgs(1),
RunE: func(cmd *cobra.Command, args []string) error {
return m.Remove(args[0])
if err := m.Remove(args[0]); err != nil {
return err
}
cs := io.ColorScheme()
fmt.Fprintf(io.Out, "%s Removed extension %s\n", cs.SuccessIcon(), args[0])
return nil
},
},
)

View file

@ -102,6 +102,7 @@ func TestNewCmdExtensions(t *testing.T) {
assert.Equal(t, "hello", calls[0].Name)
}
},
wantStdout: "✓ Removed extension hello\n",
},
}