ghlatest, gets link to latest asset

master
David Kebler 2024-04-22 17:01:01 -07:00
parent 26c7445d62
commit 5f6108a5e2
1 changed files with 13 additions and 1 deletions

View File

@ -1,3 +1,15 @@
alias gitdisall="git restore ." alias gitdisall="git restore ."
alias gitdis="git restore" alias gitdis="git restore"
ghlatest () {
OWNER=${GOWNER:-$1}
REPO=${GREPO:-$2}
ARCH=${RARCH:-$3}
ARCH=${ARCH:-linux_amd64}
dwnld=$(wget https://api.github.com/repos/$OWNER/$REPO/releases/latest -q -O - | awk -F \" -v RS="," '/browser_download_url/ {print $(NF-1)}' | grep $ARCH)
echo $dwnld
}