mirror of
https://github.com/kubescape/kubescape.git
synced 2026-02-14 18:09:55 +00:00
* fixes #964 * adapted build and ci to use build tag * fixup error messages * report git scan skipped warning & version * fixed CI on windows: powershell parsing args... * fixup leftover comment * fixup typo in test message * resolved merge conflicts on unit tests * fix: added gitenabled tag to Makefile target Signed-off-by: Frederic BIDON <fredbi@yahoo.com>
29 lines
630 B
Go
29 lines
630 B
Go
package version
|
|
|
|
import (
|
|
"fmt"
|
|
"os"
|
|
|
|
"github.com/kubescape/kubescape/v2/core/cautils"
|
|
"github.com/spf13/cobra"
|
|
)
|
|
|
|
func GetVersionCmd() *cobra.Command {
|
|
versionCmd := &cobra.Command{
|
|
Use: "version",
|
|
Short: "Get current version",
|
|
Long: ``,
|
|
RunE: func(cmd *cobra.Command, args []string) error {
|
|
v := cautils.NewIVersionCheckHandler()
|
|
v.CheckLatestVersion(cautils.NewVersionCheckRequest(cautils.BuildNumber, "", "", "version"))
|
|
fmt.Fprintf(os.Stdout,
|
|
"Your current version is: %s [git enabled in build: %t]\n",
|
|
cautils.BuildNumber,
|
|
isGitEnabled(),
|
|
)
|
|
return nil
|
|
},
|
|
}
|
|
return versionCmd
|
|
}
|