Skip to content

Instantly share code, notes, and snippets.

@TemaSM
Created July 5, 2017 12:05
Show Gist options
  • Select an option

  • Save TemaSM/63ceb62c3e29014c9eb048258450df1b to your computer and use it in GitHub Desktop.

Select an option

Save TemaSM/63ceb62c3e29014c9eb048258450df1b to your computer and use it in GitHub Desktop.

Revisions

  1. TemaSM revised this gist Jul 5, 2017. 1 changed file with 4 additions and 1 deletion.
    5 changes: 4 additions & 1 deletion download-curl-latest-github-release.sh
    Original file line number Diff line number Diff line change
    @@ -2,4 +2,7 @@
    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
    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
  2. TemaSM created this gist Jul 5, 2017.
    5 changes: 5 additions & 0 deletions download-curl-latest-github-release.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,5 @@
    # 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