Skip to content

fix(demo): guard read in pause for non-interactive execution in demo-offline.sh - #2809

Open
vaibhavsrv wants to merge 1 commit into
Osmantic:mainfrom
vaibhavsrv:fix/demo-offline-non-interactive-pause-guard
Open

fix(demo): guard read in pause for non-interactive execution in demo-offline.sh#2809
vaibhavsrv wants to merge 1 commit into
Osmantic:mainfrom
vaibhavsrv:fix/demo-offline-non-interactive-pause-guard

Conversation

@vaibhavsrv

Copy link
Copy Markdown
Contributor

Problem

In ods/scripts/demo-offline.sh, helper function pause() pauses execution between interactive demo steps by calling read -r. When demo-offline.sh is executed non-interactively or in automated CI/documentation screenshot pipelines without an interactive TTY, read -r encounters an Immediate EOF or non-zero exit code under set -e, causing script failure.

Fix

Add [[ -t 0 ]] || return 0 TTY check in pause() to bypass interactive pauses in headless environments, and append || true to read -r in demo-offline.sh.

Verification

Ran bash -n ods/scripts/demo-offline.sh (passed cleanly). Verified headless pipe execution via ./scripts/demo-offline.sh < /dev/null. git diff --check passed cleanly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant