(opts *EnableOptions)
| 44 | } |
| 45 | |
| 46 | func 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 | |
| 71 | func PromptMissing(opts *EnableOptions) error { |
| 72 | if opts.IdOrName == "" { |
no test coverage detected