Hacker News new | past | comments | ask | show | jobs | submit login

Yeah, unfortunately those are versioned so I can't even make a script to have it download https://someurl/ripgrep_latest_amd64.deb. I just added `cargo install ripgrep` to my script but that might prove too slow every time, so I'll see. Thank you!

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.

    if command -V rg > /dev/null 2>&1; then
        curvers="$(rg -V | cut -d' ' -f2)"
    latestvers="$(curl -s "$latesturl" | jq -r .tag_name)"
    if [ "$curvers" = "$latestvers" ]; then
        echo "ripgrep is up to date"
        exit 0
    (cd /tmp && curl -LO "$url" && sudo dpkg -i "$name")
    echo "ripgrep updated from $curvers to $latestvers"

I changed it a bit to be able to update more than one package: https://www.pastery.net/mushya/

This is perfect, thank you! I didn't know that there was a GH API endpoint to give you latest release names, that's pretty neat.

Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact