Skip to content

Commit 10835b1

Browse files
committed
bug-fix: don't prompt for issue # in when interactive is false
1 parent 6850417 commit 10835b1

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

git-open-pull.go

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -59,14 +59,19 @@ func GetIssueNumber(ctx context.Context, client *github.Client, settings *Settin
5959
return strconv.Atoi(n)
6060
}
6161
}
62-
n, err := input.Ask(fmt.Sprintf("issue number [%d]", detected), "")
63-
if err != nil {
64-
log.Fatal(err)
65-
}
66-
if n == "" {
67-
return detected, nil
62+
63+
if interactive {
64+
n, err := input.Ask(fmt.Sprintf("issue number [%d]", detected), "")
65+
if err != nil {
66+
log.Fatal(err)
67+
}
68+
if n == "" {
69+
return detected, nil
70+
}
71+
return strconv.Atoi(n)
6872
}
69-
return strconv.Atoi(n)
73+
74+
return detected, nil
7075
}
7176

7277
func main() {

0 commit comments

Comments
 (0)