-
-
Save CypherpunkSamurai/6afb8c1edb70e9d4bcfc72d89c366527 to your computer and use it in GitHub Desktop.
Shell - Get latest release from GitHub
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
get_latest_release() { | |
curl --silent "https://api.github.com/repos/$1/releases/latest" | # Get latest release from GitHub api | |
grep '"tag_name":' | # Get tag line | |
sed -E 's/.*"([^"]+)".*/\1/' # Pluck JSON value | |
} | |
# Usage | |
# $ get_latest_release "creationix/nvm" | |
# v0.31.4 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment