Skip to content

Instantly share code, notes, and snippets.

@k3karthic
Last active July 10, 2022 08:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save k3karthic/ad907498274d5479b42d599319bbbc2c to your computer and use it in GitHub Desktop.
Save k3karthic/ad907498274d5479b42d599319bbbc2c to your computer and use it in GitHub Desktop.
Update bootandy/dust
#!/usr/bin/env sh
## https://gist.github.com/lukechilds/a83e1d7127b78fef38c2914c4ececc3c
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
tr -d 'v' # Remove v
}
ver=$(get_latest_release "bootandy/dust")
echo "Fetching $ver..."
cd /tmp
echo https://github.com/bootandy/dust/releases/download/v$ver/dust-v$ver-x86_64-unknown-linux-gnu.tar.gz
curl -OL https://github.com/bootandy/dust/releases/download/v$ver/dust-v$ver-x86_64-unknown-linux-gnu.tar.gz
tar xzf dust-v$ver-x86_64-unknown-linux-gnu.tar.gz
cd dust-v*
mv dust $HOME/bin/dust
cd /tmp
rm -rf dust-v*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment