Merge remote-tracking branch 'origin/master' into issue-metadata-resolve-ids

This commit is contained in:
Mislav Marohnić 2020-05-13 17:20:37 +02:00
commit 57e60ab8a1
9 changed files with 618 additions and 37 deletions

View file

@ -2,7 +2,6 @@ package command
import (
"fmt"
"os"
"github.com/AlecAivazis/survey/v2"
"github.com/cli/cli/api"
@ -129,14 +128,9 @@ func selectTemplate(templatePaths []string) (string, error) {
}
func titleBodySurvey(cmd *cobra.Command, issueState *issueMetadataState, apiClient *api.Client, repo ghrepo.Interface, providedTitle, providedBody string, defs defaults, templatePaths []string, allowReviewers, allowMetadata bool) error {
editorCommand := os.Getenv("GH_EDITOR")
if editorCommand == "" {
ctx := contextForCommand(cmd)
cfg, err := ctx.Config()
if err != nil {
return fmt.Errorf("could not read config: %w", err)
}
editorCommand, _ = cfg.Get(defaultHostname, "editor")
editorCommand, err := determineEditor(cmd)
if err != nil {
return err
}
issueState.Title = defs.Title
@ -184,7 +178,7 @@ func titleBodySurvey(cmd *cobra.Command, issueState *issueMetadataState, apiClie
qs = append(qs, bodyQuestion)
}
err := SurveyAsk(qs, issueState)
err = SurveyAsk(qs, issueState)
if err != nil {
return fmt.Errorf("could not prompt: %w", err)
}