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
This commit is contained in:
+3
-1
@@ -70,7 +70,9 @@ ensure_gum() {
|
|||||||
esac
|
esac
|
||||||
url="https://github.com/charmbracelet/gum/releases/download/v${GUM_VERSION}/gum_${GUM_VERSION}_Linux_${arch}.tar.gz"
|
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
|
if ! curl -fsSL "$url" | tar -xz -C "$tmpdir" 2>/dev/null; then
|
||||||
|
echo "couldn't download gum from $url (no internet egress? falling back to plain prompts)" >&2
|
||||||
|
else
|
||||||
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
|
||||||
|
|||||||
Reference in New Issue
Block a user