fix(update): TTY-guard the gstack prompt — non-interactive runs died at EOF

RC fix (soak day 1, #3). `read -r` on the "Proceed with GStack update?"
prompt hits EOF in any non-TTY run (cron, CI, background shell) and kills
the whole update under set -e — every later step (rtk, gsd, ctx7, semgrep,
npx skills) silently never ran. Guard on [ -t 0 ]: interactive behavior
unchanged, non-TTY defaults to the safe N and continues. Proven end-to-end:
before = Error 1 at the prompt; after = full run exit 0 through step 7.5.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XpphkdTosUzokBDNG7PToS
This commit is contained in:
Bastien Chanot
2026-07-08 17:11:47 +02:00
co-authored by Claude Opus 4.8
parent 5a1fff5030
commit ce07e55e98
+8
View File
@@ -65,8 +65,16 @@ echo ""
echo "── Updating GStack submodule..." echo "── Updating GStack submodule..."
warn "GStack tracks branch = main (no commit hash). Review upstream commits before updating." warn "GStack tracks branch = main (no commit hash). Review upstream commits before updating."
echo "" echo ""
# TTY guard: in a non-interactive run (cron, CI, background shell) `read`
# hits EOF and dies under set -e — the whole update aborted mid-script.
# Default to the safe N and keep going; interactive behavior unchanged.
if [ -t 0 ]; then
printf " Proceed with GStack update? [y/N] " printf " Proceed with GStack update? [y/N] "
read -r _gstack_confirm read -r _gstack_confirm
else
info "Non-interactive run — skipping GStack update (run in a terminal to be prompted)"
_gstack_confirm="n"
fi
if [[ "$_gstack_confirm" =~ ^[Yy]$ ]]; then if [[ "$_gstack_confirm" =~ ^[Yy]$ ]]; then
# Capture gstack state before the update so we can restore it after # Capture gstack state before the update so we can restore it after
# ./setup runs (setup re-creates every symlink; without this, an # ./setup runs (setup re-creates every symlink; without this, an