Skip to content

Commit

Permalink
install: handle GitHub API JSON without newlines
Browse files Browse the repository at this point in the history
  • Loading branch information
bendrucker committed Dec 6, 2024
1 parent 0629412 commit 846dd23
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 846dd23

Please sign in to comment.