Contents

Find and download the latest release version from GitHub

Contents

From this gist.

1
2
3
4
curl -s https://api.github.com/repos/jgm/pandoc/releases/latest \
| grep "browser_download_url.*deb" \
| cut -d '"' -f 4 \
| wget -qi -

to download the latest release version of pandoc, for instance.

  • curl to get the JSON response for the latest release
  • grep to find the line containing file URL
  • cut to extract the URL
  • wget to download it