Simplify finding the latest version of a Github release
@@ -22,9 +22,8 @@ get_latest_release() {
curl --proto "=https" \
--tlsv1.2 \
--silent \
- "https://api.github.com/repos/$1/releases/latest" | # Get latest release from GitHub api
- grep '"tag_name":' | # Get tag line
- sed -E 's/.*"([^"]+)".*/\1/' # Pluck JSON value
+ "https://api.github.com/repos/$1/releases/latest" |
+ jq --raw-output '.tag_name'
}
## end helper functions
