Call cmd pkg from root

This commit is contained in:
David Wertenteil
2022-04-11 07:53:22 +03:00
parent 858d7ac2ef
commit 6e17e5ce7e
2 changed files with 5 additions and 11 deletions

View File

@@ -40,7 +40,6 @@ var ksExamples = `
func NewDefaultKubescapeCommand() *cobra.Command {
ks := core.NewKubescape()
return getRootCmd(ks)
}
@@ -82,10 +81,7 @@ func getRootCmd(ks meta.IKubescape) *cobra.Command {
return rootCmd
}
// func main() {
// ks := NewDefaultKubescapeCommand()
// err := ks.Execute()
// if err != nil {
// logger.L().Fatal(err.Error())
// }
// }
func Execute() error {
ks := NewDefaultKubescapeCommand()
return ks.Execute()
}

View File

@@ -6,9 +6,7 @@ import (
)
func main() {
ks := cmd.NewDefaultKubescapeCommand()
err := ks.Execute()
if err != nil {
if err := cmd.Execute(); err != nil {
logger.L().Fatal(err.Error())
}
}