Skip to content

Instantly share code, notes, and snippets.

@andyeff
Created March 11, 2021 13:28
Show Gist options
  • Save andyeff/98bcbd5eeeb5a479fa20fef5d14b6f42 to your computer and use it in GitHub Desktop.
Save andyeff/98bcbd5eeeb5a479fa20fef5d14b6f42 to your computer and use it in GitHub Desktop.
Get the URL for latest github cli release - debian
curl https://api.github.com/repos/cli/cli/releases/latest | jq '.assets[] | select(.name | contains("amd64.deb") ) | .browser_download_url'
@andyeff
Copy link
Author

andyeff commented Mar 11, 2021

Download the result? Wrap it in a $() command substitution.

e.g.

wget $(curl https://api.github.com/repos/cli/cli/releases/latest | jq '.assets[] | select(.name | contains("amd64.deb") ) | .browser_download_url' -r)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment