Skip to content

Instantly share code, notes, and snippets.

@TemaSM
Created July 5, 2017 12:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save TemaSM/63ceb62c3e29014c9eb048258450df1b to your computer and use it in GitHub Desktop.
Save TemaSM/63ceb62c3e29014c9eb048258450df1b to your computer and use it in GitHub Desktop.
Download latest GitHub project/repo release via curl
# Method №1:
curl -s https://api.github.com/repos/<author>/<repo>/releases/latest | grep browser_download_url | cut -d '"' -f 4 | xargs curl > release.zip
# Method №2:
curl "$(curl -s https://api.github.com/repos/<author>/<repo>/releases/latest | grep browser_download_url | cut -d '"' -f 4)" -o release.zip
# http://www.starkandwayne.com/blog/how-to-download-the-latest-release-from-github/
# https://unix.stackexchange.com/questions/323604/pipe-the-result-of-a-cut-command-to-curl
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment