Last active
July 10, 2022 08:48
-
-
Save k3karthic/ad907498274d5479b42d599319bbbc2c to your computer and use it in GitHub Desktop.
Update bootandy/dust
This file contains hidden or 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
#!/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