From 954c71e90cff72afdae0012376483d79409c896e Mon Sep 17 00:00:00 2001 From: Greg Price Date: Fri, 1 Jun 2018 16:43:23 -0700 Subject: [PATCH] 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. --- tools/push-to-pull-request | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/push-to-pull-request b/tools/push-to-pull-request index 744433861f..2f02dcafa1 100755 --- a/tools/push-to-pull-request +++ b/tools/push-to-pull-request @@ -50,7 +50,8 @@ pr_details="$(curl -s "$pr_url")" pr_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" exit 1 fi