Add confirmation to extensions remove
This commit is contained in:
parent
a6710ec506
commit
86f2df1f49
2 changed files with 7 additions and 1 deletions
|
|
@ -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
|
||||
},
|
||||
},
|
||||
)
|
||||
|
|
|
|||
|
|
@ -102,6 +102,7 @@ func TestNewCmdExtensions(t *testing.T) {
|
|||
assert.Equal(t, "hello", calls[0].Name)
|
||||
}
|
||||
},
|
||||
wantStdout: "✓ Removed extension hello\n",
|
||||
},
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue