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

Function newVarCmd

cmd/set/var.go:25–48  ·  view source on GitHub ↗
(f factory.Factory, globalFlags *flags.GlobalFlags)

Source from the content-addressed store, hash-verified

23}
24
25func newVarCmd(f factory.Factory, globalFlags *flags.GlobalFlags) *cobra.Command {
26 cmd := &varCmd{GlobalFlags: globalFlags}
27
28 varsCmd := &cobra.Command{
29 Use: "var",
30 Short: "Sets a variable",
31 Long: `
32#######################################################
33################# devspace set var ####################
34#######################################################
35Sets a specific variable
36
37Examples:
38devspace set var key=value
39devspace set var key=value key2=value2
40#######################################################
41 `,
42 RunE: func(cobraCmd *cobra.Command, args []string) error {
43 return cmd.RunSetVar(f, cobraCmd, args)
44 }}
45
46 varsCmd.Flags().BoolVar(&cmd.Overwrite, "overwrite", true, "If true will overwrite the variables value even if its set already")
47 return varsCmd
48}
49
50// RunSetVar executes the set var command logic
51func (cmd *varCmd) RunSetVar(f factory.Factory, cobraCmd *cobra.Command, args []string) error {

Callers 1

NewSetCmdFunction · 0.85

Calls 1

RunSetVarMethod · 0.95

Tested by

no test coverage detected