(opts *CreateOptions)
| 81 | } |
| 82 | |
| 83 | func createRun(opts *CreateOptions) error { |
| 84 | var optsArray []cmd.Dependable |
| 85 | var err error |
| 86 | if !opts.NoPrompt { |
| 87 | optsArray, err = PromptMissing(opts) |
| 88 | if err != nil { |
| 89 | return err |
| 90 | } |
| 91 | } else { |
| 92 | // Validate tags when running with --no-prompt |
| 93 | if len(opts.Tag.Value) > 0 { |
| 94 | tagSets, err := opts.GetAllTagsCallback() |
| 95 | if err != nil { |
| 96 | return err |
| 97 | } |
| 98 | if err := selectors.ValidateTags(opts.Tag.Value, tagSets); err != nil { |
| 99 | return err |
| 100 | } |
| 101 | } |
| 102 | |
| 103 | optsArray = append(optsArray, opts) |
| 104 | if opts.ConfigAsCode.Value { |
| 105 | opts.ConvertOptions.Project.Value = opts.Name.Value |
| 106 | optsArray = append(optsArray, opts.ConvertOptions) |
| 107 | } |
| 108 | } |
| 109 | |
| 110 | for _, o := range optsArray { |
| 111 | if err := o.Commit(); err != nil { |
| 112 | return err |
| 113 | } |
| 114 | } |
| 115 | |
| 116 | if !opts.NoPrompt { |
| 117 | fmt.Fprintln(opts.Out, "\nAutomation Commands:") |
| 118 | for _, o := range optsArray { |
| 119 | o.GenerateAutomationCmd() |
| 120 | } |
| 121 | } |
| 122 | |
| 123 | return nil |
| 124 | } |
| 125 | |
| 126 | func PromptMissing(opts *CreateOptions) ([]cmd.Dependable, error) { |
| 127 | nestedOpts := []cmd.Dependable{} |
no test coverage detected