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() {