Compare commits

2 Commits
Author SHA1 Message Date
haylanandClaude-Bot e151aa6ffe feat(update.sh): vendor gum binary for the R9700's offline install
The server has no outbound internet access, so the curl download in
ensure_gum always failed silently and fell back to plain prompts.
Vendor the x86_64 release tarball under scripts/vendor/ and check it
before attempting a download - download stays as a fallback for other
archs or a version bump without a re-vendor.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Bs8xf8Dt8X6tRBvBiLCXYc
2026-09-07 20:04:56 +02:00
haylanandClaude-Bot feb7469f0b fix(update.sh): report why gum auto-install failed instead of failing silently
curl -fsSL | tar swallowed curl errors entirely, so a network failure
fetching gum looked identical to a successful skip - just silently
dropped into the plain-prompt fallback with no explanation.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Bs8xf8Dt8X6tRBvBiLCXYc
2026-09-07 20:01:20 +02:00
2 changed files with 16 additions and 10 deletions
+16 -10
View File
@@ -48,13 +48,11 @@ git pull --ff-only
[ -f .env ] || cp .env.example .env [ -f .env ] || cp .env.example .env
echo "==> syncing tracked config values from .env.example" echo "==> syncing tracked config values from .env.example"
# ponytail: gum (charmbracelet/gum) is a single static binary, fetched as a # ponytail: gum (charmbracelet/gum) is a single static binary. Vendored as
# release tarball — no build step, no package-manager dependency. Cached # a release tarball under scripts/vendor/ (checked into git) for the R9700
# under .cache/gum/ (gitignored) so repeat runs don't re-download. Release # box, which has no outbound internet access — the download fallback below
# asset naming (gum_<ver>_Linux_<arch>.tar.gz) follows charm's standard # is only for other archs / when the vendored copy is missing or stale.
# goreleaser convention but hasn't been exercised against a real download # Cached under .cache/gum/ (gitignored) so repeat runs don't re-extract.
# on this exact host yet — if it 404s, check
# https://github.com/charmbracelet/gum/releases for the current naming.
GUM_VERSION="0.14.5" GUM_VERSION="0.14.5"
GUM_DIR="$(pwd)/.cache/gum" GUM_DIR="$(pwd)/.cache/gum"
GUM_BIN="$GUM_DIR/gum" GUM_BIN="$GUM_DIR/gum"
@@ -62,15 +60,23 @@ ensure_gum() {
command -v gum >/dev/null 2>&1 && { echo "gum"; return; } command -v gum >/dev/null 2>&1 && { echo "gum"; return; }
[ -x "$GUM_BIN" ] && { echo "$GUM_BIN"; return; } [ -x "$GUM_BIN" ] && { echo "$GUM_BIN"; return; }
mkdir -p "$GUM_DIR" mkdir -p "$GUM_DIR"
local arch tmpdir url local arch tmpdir vendored
case "$(uname -m)" in case "$(uname -m)" in
x86_64) arch="x86_64" ;; x86_64) arch="x86_64" ;;
aarch64|arm64) arch="arm64" ;; aarch64|arm64) arch="arm64" ;;
*) echo "no gum build for $(uname -m), falling back to plain prompts" >&2; echo ""; return ;; *) echo "no gum build for $(uname -m), falling back to plain prompts" >&2; echo ""; return ;;
esac esac
url="https://github.com/charmbracelet/gum/releases/download/v${GUM_VERSION}/gum_${GUM_VERSION}_Linux_${arch}.tar.gz"
tmpdir="$(mktemp -d)" tmpdir="$(mktemp -d)"
if curl -fsSL "$url" | tar -xz -C "$tmpdir" 2>/dev/null; then vendored="$(pwd)/scripts/vendor/gum_${GUM_VERSION}_Linux_${arch}.tar.gz"
if [ -f "$vendored" ]; then
tar -xz -C "$tmpdir" -f "$vendored"
else
local url="https://github.com/charmbracelet/gum/releases/download/v${GUM_VERSION}/gum_${GUM_VERSION}_Linux_${arch}.tar.gz"
if ! curl -fsSL "$url" | tar -xz -C "$tmpdir" 2>/dev/null; then
echo "no vendored gum for $arch and couldn't download from $url (no internet egress? falling back to plain prompts)" >&2
fi
fi
if [ -n "$(find "$tmpdir" -name gum -type f 2>/dev/null)" ]; then
find "$tmpdir" -name gum -type f -exec cp {} "$GUM_BIN" \; find "$tmpdir" -name gum -type f -exec cp {} "$GUM_BIN" \;
chmod +x "$GUM_BIN" 2>/dev/null || true chmod +x "$GUM_BIN" 2>/dev/null || true
fi fi
Binary file not shown.