From 4b710e8528d39de369187ab9846d4ab1c4c8fea3 Mon Sep 17 00:00:00 2001 From: Christian Neukirchen Date: Tue, 23 Feb 2016 17:47:40 +0100 Subject: Show when no open PR are there --- git-merge-pr | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 -- cgit 1.4.1