about summary refs log tree commit diff
diff options
context:
space:
mode:
-rwxr-xr-xgit-merge-pr4
1 files changed, 3 insertions, 1 deletions
diff --git a/git-merge-pr b/git-merge-pr
index 4e59fe8..464f5f6 100755
--- a/git-merge-pr
+++ b/git-merge-pr
@@ -19,7 +19,9 @@ PROJECT=${PROJECT#//github.com/}
 if [ -z "$PR" ]; then
 	wget -q -O- --header 'Accept: application/json' \
 		"https://api.github.com/repos/${PROJECT}/pulls?direction=asc" |
-		jq -r '.[] | "\(.number) <\(.user.login)> \(.title)"'
+		jq -r 'if length > 0
+			then .[] | "\(.number) <\(.user.login)> \(.title)"
+			else "No open pull requests." end'
 	exit $?
 else
 	shift