Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save Nitecon/0340080389c9a371d6e18e37392a799f to your computer and use it in GitHub Desktop.
Save Nitecon/0340080389c9a371d6e18e37392a799f to your computer and use it in GitHub Desktop.
# This takes an owner of a repo, the repo name iteself and then looks up latest tag and gets the tarball url downloads the file.
# then extracts it to /tmp/$REPO
OWNER=iMicknl;REPO=ha-nest-protect; curl -o ${REPO}.tar.gz -L $(curl -s https://api.github.com/repos/${OWNER}/${REPO}/releases/latest | grep "tarball_url" | cut -d : -f 2,3 | tr -d \"|tr -d , | awk '{$1=$1};1') && mkdir -p /tmp/${REPO}; tar -xf ${REPO}.tar.gz --strip-components=1 -C /tmp/${REPO}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment