Skip to content

Instantly share code, notes, and snippets.

@lalyos
Last active September 13, 2017 10:38
Show Gist options
  • Save lalyos/e11ff07ec4c1edf0b3f7d733e203c5a3 to your computer and use it in GitHub Desktop.
Save lalyos/e11ff07ec4c1edf0b3f7d733e203c5a3 to your computer and use it in GitHub Desktop.
Download binary asset from private github repo

latest release assets

export GITHUB_REPO=hortonworks/hdc-cli

curl -s \
 -H "Authorization: token $GITHUB_TOKEN" \
   https://api.github.com/repos/$GITHUB_REPO/releases/latest \
    | jq ".assets[]|[.name,.url][]" -r \
    | xargs -t -n 2 -P 3 curl -sG -d access_token=$GH_TOKEN -H "Accept: application/octet-stream" -Lo

Specified versions assets

export VERSION=1.6.0-rc.1
export GITHUB_REPO=hortonworks/hdc-cli

 curl -s -G \
   -d access_token=$GITHUB_TOKEN \
   https://api.github.com/repos/$GITHUB_REPO/releases/tags/v$VERSION \
    | jq ".assets[]|[.name,.url][]" -r \
    | xargs -t -n 2 -P 3 curl -sG -d access_token=$GH_TOKEN -H "Accept: application/octet-stream" -Lo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment