fix(agent-task create): only prompt for problem statement if not provided
Signed-off-by: Babak K. Shandiz <babakks@github.com>
This commit is contained in:
parent
6945fc0183
commit
b463395d48
1 changed files with 6 additions and 6 deletions
|
|
@ -109,12 +109,16 @@ func createRun(opts *CreateOptions) error {
|
|||
return fmt.Errorf("a repository is required; re-run in a repository or supply one with --repo owner/name")
|
||||
}
|
||||
|
||||
// Prompt for ProblemStatement if not provided non-interactively
|
||||
if opts.Prompter != nil && opts.IO.CanPrompt() {
|
||||
if opts.ProblemStatement == "" {
|
||||
if !opts.IO.CanPrompt() {
|
||||
return cmdutil.FlagErrorf("a task description or -F is required when running non-interactively")
|
||||
}
|
||||
|
||||
desc, err := opts.Prompter.MarkdownEditor("Enter the task description", opts.ProblemStatement, false)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
trimmed := strings.TrimSpace(desc)
|
||||
if trimmed == "" {
|
||||
return cmdutil.FlagErrorf("a task description is required")
|
||||
|
|
@ -122,10 +126,6 @@ func createRun(opts *CreateOptions) error {
|
|||
opts.ProblemStatement = trimmed
|
||||
}
|
||||
|
||||
if opts.ProblemStatement == "" {
|
||||
return cmdutil.FlagErrorf("a task description or -F is required when running non-interactively")
|
||||
}
|
||||
|
||||
client, err := opts.CapiClient()
|
||||
if err != nil {
|
||||
return err
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue