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

Function PromptVersionControl

pkg/cmd/project/variables/create/create.go:366–385  ·  view source on GitHub ↗
(opts *CreateOptions, project *projects.Project)

Source from the content-addressed store, hash-verified

364}
365
366func 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
387func getVariableTypeOptions() []*selectors.SelectOption[string] {
388 return []*selectors.SelectOption[string]{

Calls 1

AskMethod · 0.65