Skip to content

Commit

Permalink
added the sub command left to add the logic
Browse files Browse the repository at this point in the history
Signed-off-by: Dipankar Das <65275144+dipankardas011@users.noreply.github.com>
  • Loading branch information
dipankardas011 committed Aug 1, 2024
1 parent 074083a commit 7722cad
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 12 deletions.
31 changes: 31 additions & 0 deletions cli/cmd/upgrade.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
package cmd

import (
"os"

"github.com/ksctl/cli/logger"
"github.com/ksctl/ksctl/pkg/types"

"github.com/spf13/cobra"
)

var selfUpdate = &cobra.Command{
Use: "self-update",
Short: "update the ksctl cli",
Long: "setups up update for ksctl cli",
Run: func(cmd *cobra.Command, args []string) {
verbosity, _ := cmd.Flags().GetInt("verbose")
var log types.LoggerFactory = logger.NewLogger(verbosity, os.Stdout)

newVer := "TODO"

log.Success(ctx, "Updated Ksctl cli", "previousVer", Version, "newVer", newVer)
},
}

func init() {
RootCmd.AddCommand(selfUpdate)
storageFlag(selfUpdate)

selfUpdate.Flags().BoolP("verbose", "v", true, "for verbose output")
}
13 changes: 1 addition & 12 deletions cli/cmd/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,6 @@ const (
| <\__ \ (__| |_| |
|_|\_\___/\___|\__|_|
`

v1_0Ksctl = `
__ __ .__
| | __ ______ ____ _/ |_ | |
| |/ / / ___/_/ ___\\ __\| |
| < \___ \ \ \___ | | | |__
|__|_ \/____ > \___ >|__| |____/
\/ \/ \/
`

v2_0Ksctl = `
Expand All @@ -48,9 +39,7 @@ var versionCmd = &cobra.Command{
Short: "Print the version number of ksctl",
Run: func(cmd *cobra.Command, args []string) {

fmt.Println(v0_1Ksctl)

color.HiGreen(v1_0Ksctl)
color.HiGreen(v0_1Ksctl)

x := strings.Split(v2_0Ksctl, "\n")

Expand Down

0 comments on commit 7722cad

Please sign in to comment.