-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Provide a cli command to download the latest release of the bin
directly
#192
Comments
SGTM! Any chance you'd like to open a PR for it? I can take care of uploading the script somewhere afterwards |
I invented a not-one-lined script that does this: #!/bin/bash
URL="marcosnils/bin"
LATEST_RELEASE=$(curl -s https://api.github.com/repos/$URL/releases/latest)
TAG_NAME=$(echo $LATEST_RELEASE | jq -r '.tag_name' | cut -c 2-)
FILENAME="bin_${TAG_NAME}_linux_amd64"
DOWNLOAD_URL=$(echo $LATEST_RELEASE | jq -r '.assets[] | select(.name | startswith("'"$FILENAME"'")) | .browser_download_url')
curl -s -L -o bin $DOWNLOAD_URL
chmod +x ./bin It's complex because the release binary has the version name in the filename. If it be something static like just
|
One more example here: https://kubernetes.io/docs/tasks/tools/install-kubectl-linux/
|
I really would like to see this version. @marcosnils: Any chance to remove the version from the filename? |
Now in the readme, we have a recommendation to Download the
bin
from the releases page manually.But for some users, and especially for automation in scripts, it's good to have a CLI command to do this directly, better as a one-liner.
The text was updated successfully, but these errors were encountered: