push-to-pull-request: Give a nice error if `jq` missing.

This commit is contained in:
Greg Price 2018-07-23 23:10:15 -07:00
parent eaeec30590
commit 26d0904436
1 changed files with 12 additions and 0 deletions

View File

@ -30,6 +30,18 @@ if [ -z "$pr_id" ]; then
usage usage
fi fi
if ! jq --version >/dev/null 2>&1; then
cat >&2 <<EOF
error: not found: jq
push-to-pull-request requires the \`jq\` utility; you should install it.
Try:
sudo apt install jq
EOF
exit 1
fi
remote_url="$(git config remote."$remote".url)" remote_url="$(git config remote."$remote".url)"
repo_fq="$(echo "$remote_url" | perl -lne 'print $1 if ( repo_fq="$(echo "$remote_url" | perl -lne 'print $1 if (
m, ^ git\@github\.com: m, ^ git\@github\.com: