push-to-pull-request: Use `jq -r` to simplify a test slightly.

This option (aka `--raw-output`) prints a string as itself, rather
than JSON-encoded; which makes it fit a bit better in a shell script,
saving us a layer of quoting.
This commit is contained in:
Greg Price 2018-06-01 16:43:23 -07:00
parent 8e81ca0fb2
commit 954c71e90c
1 changed files with 2 additions and 1 deletions

View File

@ -50,7 +50,8 @@ pr_details="$(curl -s "$pr_url")"
pr_jq () { pr_jq () {
echo "$pr_details" | jq "$@" echo "$pr_details" | jq "$@"
} }
if [ "$(pr_jq .message)" = '"Not Found"' ]; then
if [ "$(pr_jq -r .message)" = "Not Found" ]; then
echo "Invalid PR URL: $pr_url" echo "Invalid PR URL: $pr_url"
exit 1 exit 1
fi fi