orb: install gh stack during setup

Make stacked PR commands available in fresh orbs without a manual extension install. Skip installation when github/gh-stack is already present.

Tests: full setup with an empty extension directory fails the availability check before this change and passes afterward; a second run preserves the installed executable; bash -n and login-shell availability checks pass.
Amp-Thread-ID: https://ampcode.com/threads/T-01a136e4-bd19-76ac-8b5f-28d83b5dc9c7
Co-authored-by: pedro muniz <pedro.muniz.carlo@gmail.com>
This commit is contained in:
Amp
2026-10-14 14:34:41 +00:00
parent 2989e3104b
commit 9454cdaab3

View File

@@ -66,6 +66,15 @@ fi
export PATH="$HOME/.local/node-v24/bin:$HOME/.cargo/bin:$HOME/.local/bin:/usr/local/go/bin:$PATH"
printf '[orb setup] Shell tool paths ready in %ss\n' "$((SECONDS - step_started))"
printf '\n[orb setup] Checking gh stack\n'
step_started=$SECONDS
if ! gh extension list | grep -Fq 'github/gh-stack'; then
gh extension install github/gh-stack
else
printf '[orb setup] gh stack is already installed\n'
fi
printf '[orb setup] gh stack ready in %ss\n' "$((SECONDS - step_started))"
printf '\n[orb setup] Checking Rust toolchain\n'
step_started=$SECONDS
if ! command -v rustup >/dev/null 2>&1; then