MCPcopy Create free account
hub / github.com/OctopusDeploy/cli / disableRun

Function disableRun

pkg/cmd/project/enable/enable.go:46–69  ·  view source on GitHub ↗
(opts *EnableOptions)

Source from the content-addressed store, hash-verified

44}
45
46func disableRun(opts *EnableOptions) error {
47 if !opts.NoPrompt {
48 if err := PromptMissing(opts); err != nil {
49 return err
50 }
51 }
52
53 if opts.IdOrName == "" {
54 return fmt.Errorf("project identifier is required but was not provided")
55 }
56
57 projectToEnable, err := projects.GetByIdentifier(opts.Client, opts.Client.GetSpaceID(), opts.IdOrName)
58 if err != nil {
59 return err
60 }
61
62 projectToEnable.IsDisabled = false
63 _, err = projects.Update(opts.Client, projectToEnable)
64 if err != nil {
65 return err
66 }
67
68 return nil
69}
70
71func PromptMissing(opts *EnableOptions) error {
72 if opts.IdOrName == "" {

Callers 1

NewCmdEnableFunction · 0.70

Calls 1

PromptMissingFunction · 0.70

Tested by

no test coverage detected