zsh: add github binary fallbacks for bat/zoxide/delta (fixes RHEL/Alma without EPEL/cargo)

On RHEL-family distros without EPEL enabled and without cargo, the PM
loop fails for bat/zoxide/git-delta and there was no fallback, so they
ended up skipped/FAIL. Now, after the PM/cargo attempts fail, download
the latest static release tarball from GitHub instead, matching the
existing pattern for eza/fastfetch/starship/lazydocker.

- Add _gh_latest_tag(): resolve latest release tag from the
  /releases/latest redirect (no GitHub API, no rate limits)
- Add _gh_install_bin(): build the asset URL from a versioned template,
  download, extract, and cp the named binary into ~/.local/bin
- Handle per-repo tag conventions: bat/zoxide tags are 'v0.x' while
  delta tags are bare '0.x'; keep the raw tag for the download path and
  strip the optional 'v' only for asset-filename substitution
- Add target_musl/target_gnu per-arch (x86_64/aarch64/armv7l)
- bat/zoxide use static musl builds (no glibc deps); delta ships gnu-only
- Verbose 'gh installing <bin> (<tag> from <repo>)' / FAIL lines
- Bump ZSHRC_BOOTSTRAP_VERSION 3 -> 4 so existing boxes re-run the
  bootstrap and pick up the new fallbacks

Verified end-to-end: bat 0.26.1, zoxide 0.10.0, delta 0.19.2 all
download, extract, install, and run from a temp HOME.
This commit is contained in:
2026-07-29 12:11:31 -04:00
parent 0281b06154
commit 18af4de0c0
3 changed files with 68 additions and 5 deletions
+1 -1
View File
@@ -6,7 +6,7 @@ export ZSHRC_GIT="https://git.jeremymcclure.com/jeremy/scripts/raw/branch/master
export ZSHRC_URL="$ZSHRC_GIT/zshrc"
export ZSHRC_BOOTSTRAP_URL="$ZSHRC_GIT/zshrc-bootstrap.zsh"
export ZSHRC_BOOTSTRAP_VERSION="3"
export ZSHRC_BOOTSTRAP_VERSION="4"
export ZSHRC_BOOTSTRAP="$ZSH_CONFIG/.bootstrapped"
[[ -d "$HOME/Scripts" ]] && path+=("$HOME/Scripts")