Created
April 5, 2018 11:37
-
-
Save rahulkj/11767d6fb2909f6264de4df2813fce34 to your computer and use it in GitHub Desktop.
This file contains 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() { | |
DOWNLOAD_URL=$(curl --silent "https://api.github.com/repos/$1/releases/latest" | \ | |
jq -r \ | |
--arg flavor $2 '.assets[] | select(.name | contains($flavor)) | .browser_download_url') | |
echo $DOWNLOAD_URL | |
} | |
get_latest_release "cloudfoundry-incubator/credhub-cli" "linux" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment