| 364 | } |
| 365 | |
| 366 | func PromptVersionControl(opts *CreateOptions, project *projects.Project) error { |
| 367 | if !project.IsVersionControlled { |
| 368 | return nil |
| 369 | } |
| 370 | |
| 371 | if opts.GitRef.Value == "" { |
| 372 | if err := opts.Ask(&survey.Input{ |
| 373 | Message: "GitRef", |
| 374 | Help: fmt.Sprintf("The GitRef where the variable is stored"), |
| 375 | }, &opts.GitRef.Value, survey.WithValidator(survey.ComposeValidators( |
| 376 | survey.MaxLength(200), |
| 377 | survey.MinLength(1), |
| 378 | survey.Required, |
| 379 | ))); err != nil { |
| 380 | return err |
| 381 | } |
| 382 | } |
| 383 | |
| 384 | return nil |
| 385 | } |
| 386 | |
| 387 | func getVariableTypeOptions() []*selectors.SelectOption[string] { |
| 388 | return []*selectors.SelectOption[string]{ |