tmux, bash, mgmt fiddling

This commit is contained in:
Robert Perce 2026-03-25 10:50:18 -05:00
parent 6649cfc78d
commit c653422734
11 changed files with 160 additions and 11 deletions

View file

@ -0,0 +1,18 @@
# shellcheck shell=bash
github_latest() {
repo="$1"
tag="${2:-latest}"
if [ "$tag" = "--no-latest-tag" ]; then
curl -sfSL "https://github.com/$repo/tags" \
| perl -ne 'm,a href="/'"$repo"'/releases/tag/v(\d\.\d(?:.\d)?)", && print "$1\n"' \
| sort -V \
| tail -n1 || echo "[github error]"
else
curl -sfSI "https://github.com/$repo/releases/$tag" \
| grep '^location' \
| awk -F/ '{print $NF}' \
| sed 's/\s\+$//' || echo "[github error]"
fi
}