From 846dd23e6db73af2f98e52cfc00978157e6503c3 Mon Sep 17 00:00:00 2001 From: Ben Drucker Date: Fri, 6 Dec 2024 11:05:22 -0800 Subject: [PATCH] install: handle GitHub API JSON without newlines --- install_linux.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/install_linux.sh b/install_linux.sh index d12d645cc..b61bca43f 100755 --- a/install_linux.sh +++ b/install_linux.sh @@ -43,8 +43,8 @@ get_latest_release() { headers=(-H "Authorization: Bearer ${GITHUB_TOKEN}") fi curl --fail -sS "${headers[@]}" "https://api.github.com/repos/terraform-linters/tflint/releases/latest" | # Get latest release from GitHub api - grep '"tag_name":' | # Get tag line - sed -E 's/.*"([^"]+)".*/\1/' # Pluck JSON value + grep '"tag_name":' | # Filter other lines from multiline JSON + sed -E 's/.*"tag_name"[[:space:]]*:[[:space:]]*"([^"]+)".*/\1/' # Get tag_name value } download_path=$(mktemp -d -t tflint.XXXXXXXXXX)