(opts *CreateOptions)
| 133 | } |
| 134 | |
| 135 | func PromptMissing(opts *CreateOptions) error { |
| 136 | err := question.AskName(opts.Ask, "", "environment", &opts.Name.Value) |
| 137 | if err != nil { |
| 138 | return err |
| 139 | } |
| 140 | |
| 141 | err = question.AskDescription(opts.Ask, "", "environment", &opts.Description.Value) |
| 142 | if err != nil { |
| 143 | return err |
| 144 | } |
| 145 | |
| 146 | _, err = promptBool(opts, &opts.GuidedFailureMode.Value, false, "Use guided failure", "If guided failure is enabled for an environment, Octopus Deploy will prompt for user intervention if a deployment fails in the environment.") |
| 147 | _, err = promptBool(opts, &opts.DynamicInfrastructure.Value, false, "Allow dynamic infrastructure", "If dynamic infrastructure is enabled for an environment, deployments to this environment are allowed to create infrastructure, such as targets and accounts.") |
| 148 | |
| 149 | tagSets, err := opts.GetAllTagsCallback() |
| 150 | if err != nil { |
| 151 | return err |
| 152 | } |
| 153 | |
| 154 | tags, err := selectors.Tags(opts.Ask, []string{}, opts.Tag.Value, tagSets) |
| 155 | if err != nil { |
| 156 | return err |
| 157 | } |
| 158 | opts.Tag.Value = tags |
| 159 | |
| 160 | return nil |
| 161 | } |
| 162 | |
| 163 | func promptBool(opts *CreateOptions, value *bool, defaultValue bool, message string, help string) (bool, error) { |
| 164 | if *value != defaultValue { |
no test coverage detected