Skip to content

Commit

Permalink
install: handle GitHub API JSON without newlines (#2176)
Browse files Browse the repository at this point in the history
  • Loading branch information
bendrucker authored Dec 9, 2024
1 parent 7257a10 commit 6188f87
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions install_linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 6188f87

Please sign in to comment.