fix comp delete err

Signed-off-by: guoxudong <sunnydog0826@gmail.com>
This commit is contained in:
guoxudong
2020-09-04 14:38:21 +08:00
parent 7232509f26
commit ed9fe6ad25
+6 -2
View File
@@ -82,14 +82,18 @@ func NewCompDeleteCommand(c types.Args, ioStreams cmdutil.IOStreams) *cobra.Comm
return err
}
if len(args) < 1 {
return errors.New("must specify name for the app")
return errors.New("must specify name for the component")
}
o.CompName = args[0]
appName, err := cmd.Flags().GetString(App)
if err != nil {
return err
}
o.AppName = appName
if appName != ""{
o.AppName = appName
}else {
o.AppName = o.CompName
}
ioStreams.Infof("Deleting Component '%s' from Application '%s'\n", o.CompName, o.AppName)
err, message := o.DeleteComponent()