MCPcopy Index your code
hub / github.com/devspace-sh/devspace / NewUpgradeCmd

Function NewUpgradeCmd

cmd/upgrade.go:18–39  ·  view source on GitHub ↗

NewUpgradeCmd creates a new upgrade command

()

Source from the content-addressed store, hash-verified

16
17// NewUpgradeCmd creates a new upgrade command
18func NewUpgradeCmd() *cobra.Command {
19 cmd := &UpgradeCmd{}
20
21 upgradeCmd := &cobra.Command{
22 Use: "upgrade",
23 Short: "Upgrades the DevSpace CLI to the newest version",
24 Long: `
25#######################################################
26################## devspace upgrade ###################
27#######################################################
28Upgrades the DevSpace CLI to the newest version
29#######################################################`,
30 Args: cobra.NoArgs,
31 RunE: func(cobraCmd *cobra.Command, args []string) error {
32 plugin.SetPluginCommand(cobraCmd, args)
33 return cmd.Run()
34 },
35 }
36
37 upgradeCmd.Flags().StringVar(&cmd.Version, "version", "", "The version to update devspace to. Defaults to the latest stable version available")
38 return upgradeCmd
39}
40
41// Run executes the command logic
42func (cmd *UpgradeCmd) Run() error {

Callers 1

BuildRootFunction · 0.85

Calls 2

RunMethod · 0.95
SetPluginCommandFunction · 0.92

Tested by

no test coverage detected