- Use
curl
to get the JSON response for the latest release - Use
grep
to find the line containing file URL - Use
cut
andtr
to extract the URL - Use
wget
to download it
curl -s https://api.github.com/repos/jgm/pandoc/releases/latest \
| grep "browser_download_url.*deb" \
| cut -d : -f 2,3 \
| tr -d \" \
| wget -qi -
Shameless self-promotion, but i did that for community as well. https://ghd.one
Enter repository URL, filter down the list to only one single file, get your permanent link for download.
Example for Gitea repository: https://ghd.one/go-gitea/gitea
Filtered to Linux binary 64bit without extension: https://ghd.one/go-gitea/gitea?includes=linux+amd64&excludes=amd64.
Filtered to Windows 64bit executable file: https://ghd.one/go-gitea/gitea?includes=windows+amd64&excludes=gogit+.exe.
More about it on reddit: https://www.reddit.com/r/programming/comments/o1yit0/ghd_get_github_direct_links_without_pain_wip/