From 10835b12cbd631a57f3f2768e4283819de13cf70 Mon Sep 17 00:00:00 2001 From: Jay Donigian Date: Fri, 10 Oct 2025 19:46:55 +0000 Subject: [PATCH] bug-fix: don't prompt for issue # in when interactive is false --- git-open-pull.go | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/git-open-pull.go b/git-open-pull.go index 90a3b82..8b62909 100644 --- a/git-open-pull.go +++ b/git-open-pull.go @@ -59,14 +59,19 @@ func GetIssueNumber(ctx context.Context, client *github.Client, settings *Settin return strconv.Atoi(n) } } - n, err := input.Ask(fmt.Sprintf("issue number [%d]", detected), "") - if err != nil { - log.Fatal(err) - } - if n == "" { - return detected, nil + + if interactive { + n, err := input.Ask(fmt.Sprintf("issue number [%d]", detected), "") + if err != nil { + log.Fatal(err) + } + if n == "" { + return detected, nil + } + return strconv.Atoi(n) } - return strconv.Atoi(n) + + return detected, nil } func main() {