2 ms·
Here's a quick little script I put together that should do the trick. It's idempotent, so it won't do anything if there are no updates. I did use `jq` for conve
by burntsushi 8y ago
Here's a quick little script I put together that should do the trick. It's idempotent, so it won't do anything if there are no updates. I did use `jq` for convenience though.
#!/bin/sh
curvers=
if command -V rg > /dev/null 2>&1; then
curvers="$(rg -V | cut -d' ' -f2)"
fi
latesturl="https://api.github.com/repos/BurntSushi/ripgrep/releases/latest"
latestvers="$(curl -s "$latesturl" | jq -r .tag_name)"
if [ "$curvers" = "$latestvers" ]; then
echo "ripgrep is up to date"
exit 0
fi
name="ripgrep_${latestvers}_amd64.deb"
url="https://github.com/BurntSushi/ripgrep/releases/download/$latestvers/$name"
(cd /tmp && curl -LO "$url" && sudo dpkg -i "$name")
echo "ripgrep updated from $curvers to $latestvers"