mirror of
https://github.com/kubescape/kubescape.git
synced 2026-04-15 06:58:11 +00:00
update latest version check
This commit is contained in:
+2
-13
@@ -12,7 +12,7 @@ import (
|
||||
var (
|
||||
sha1ver string
|
||||
buildTime string
|
||||
run_number string
|
||||
Run_number string
|
||||
)
|
||||
|
||||
// versionCmd represents the version command
|
||||
@@ -21,18 +21,7 @@ var versionCmd = &cobra.Command{
|
||||
Short: "Get current version",
|
||||
Long: ``,
|
||||
RunE: func(cmd *cobra.Command, args []string) error {
|
||||
fmt.Println(sha1ver)
|
||||
fmt.Println(buildTime)
|
||||
latest, err := GetLatestVersion()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
fmt.Println(latest)
|
||||
if latest == run_number {
|
||||
fmt.Println("Updated")
|
||||
} else {
|
||||
fmt.Println("Not updated")
|
||||
}
|
||||
fmt.Println("Your current version is: " + Run_number)
|
||||
return nil
|
||||
},
|
||||
}
|
||||
|
||||
@@ -1,10 +1,20 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/armosec/kubescape/cmd"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
||||
CheckLatestVersion()
|
||||
cmd.Execute()
|
||||
}
|
||||
|
||||
func CheckLatestVersion() {
|
||||
latest, _ := cmd.GetLatestVersion()
|
||||
if latest != cmd.Run_number {
|
||||
fmt.Println("Warning: You are not updated to the latest release: " + latest)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user