(opts *CreateOptions)
| 58 | } |
| 59 | |
| 60 | func createRun(opts *CreateOptions) error { |
| 61 | var optsArray []cmd.Dependable |
| 62 | var err error |
| 63 | if !opts.NoPrompt { |
| 64 | optsArray, err = PromptMissing(opts) |
| 65 | if err != nil { |
| 66 | return err |
| 67 | } |
| 68 | } else { |
| 69 | // Validate tags when running with --no-prompt |
| 70 | if len(opts.Tag.Value) > 0 { |
| 71 | tagSets, err := opts.GetAllTagsCallback() |
| 72 | if err != nil { |
| 73 | return err |
| 74 | } |
| 75 | if err := selectors.ValidateTags(opts.Tag.Value, tagSets); err != nil { |
| 76 | return err |
| 77 | } |
| 78 | } |
| 79 | optsArray = append(optsArray, opts) |
| 80 | } |
| 81 | |
| 82 | for _, o := range optsArray { |
| 83 | if err := o.Commit(); err != nil { |
| 84 | return err |
| 85 | } |
| 86 | } |
| 87 | |
| 88 | if !opts.NoPrompt { |
| 89 | fmt.Fprintln(opts.Out, "\nAutomation Commands:") |
| 90 | for _, o := range optsArray { |
| 91 | o.GenerateAutomationCmd() |
| 92 | } |
| 93 | } |
| 94 | |
| 95 | return nil |
| 96 | } |
| 97 | |
| 98 | func PromptMissing(opts *CreateOptions) ([]cmd.Dependable, error) { |
| 99 | nestedOpts := []cmd.Dependable{} |
no test coverage detected