From e5266e5b559b56f99ec796410e54559e8668a22a Mon Sep 17 00:00:00 2001 From: Viet Hoang <1300077+vietqhoang@users.noreply.github.com> Date: Mon, 27 Jun 2022 10:56:56 -0700 Subject: [PATCH 1/2] Replace with bash equivalent --- bin/compile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/compile b/bin/compile index c62ec03..6fd314a 100755 --- a/bin/compile +++ b/bin/compile @@ -29,7 +29,7 @@ fi cache_get_url=$(curl -s https://api.heroku.com/apps/$SHARED_BUILD_CACHE_APP_NAME/build-metadata \ -H "Accept: application/vnd.heroku+json; version=3.build-metadata" \ -H "Authorization: Bearer $HEROKU_API_KEY" \ - | ruby -e "require 'json'; print JSON[STDIN.read]['cache_get_url']") + | jq '.cache_get_url' | tr -d '"') echo "Restoring shared build cache from app [$SHARED_BUILD_CACHE_APP_NAME]..." From 815ed11f0a85ec7588c941961740206621563b0b Mon Sep 17 00:00:00 2001 From: Viet Hoang <1300077+vietqhoang@users.noreply.github.com> Date: Mon, 27 Jun 2022 15:23:51 -0700 Subject: [PATCH 2/2] Use `-r` flag instead on `jq` MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This will do a raw output, which doesn’t include the surrounding double quotes. --- bin/compile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/compile b/bin/compile index 6fd314a..8edbabb 100755 --- a/bin/compile +++ b/bin/compile @@ -29,7 +29,7 @@ fi cache_get_url=$(curl -s https://api.heroku.com/apps/$SHARED_BUILD_CACHE_APP_NAME/build-metadata \ -H "Accept: application/vnd.heroku+json; version=3.build-metadata" \ -H "Authorization: Bearer $HEROKU_API_KEY" \ - | jq '.cache_get_url' | tr -d '"') + | jq -r '.cache_get_url') echo "Restoring shared build cache from app [$SHARED_BUILD_CACHE_APP_NAME]..."