fix: use /dev/tty directly for interactive docs/ prompt
- remove /dev/tty stdin redirect from exec (unreliable on macOS) - check [[ -e /dev/tty ]] instead of [[ -t 0 ]] — works through curl | bash - read answer directly from /dev/tty, bypassing piped stdin
This commit is contained in:
parent
8d3758cd6c
commit
6c0a40f186
7
apply.sh
7
apply.sh
@ -18,8 +18,7 @@ if [[ -z "${BASH_SOURCE[0]:-}" ]]; then
|
|||||||
git clone "$REPO_URL" "$TARGET" || { echo "✗ git clone failed"; exit 1; }
|
git clone "$REPO_URL" "$TARGET" || { echo "✗ git clone failed"; exit 1; }
|
||||||
fi
|
fi
|
||||||
# Pass DEV_ROOT explicitly — local mode must not guess it from script location
|
# Pass DEV_ROOT explicitly — local mode must not guess it from script location
|
||||||
# Reopen stdin from /dev/tty so local mode can prompt interactively
|
exec bash "$TARGET/apply.sh" --bootstrapped "$DEV_ROOT"
|
||||||
exec bash "$TARGET/apply.sh" --bootstrapped "$DEV_ROOT" </dev/tty
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# ── Guard — block direct invocation ──────────────────────────────────────────
|
# ── Guard — block direct invocation ──────────────────────────────────────────
|
||||||
@ -78,9 +77,9 @@ setup_project() {
|
|||||||
# FR-5 + FR-6: docs
|
# FR-5 + FR-6: docs
|
||||||
local docs="$project/docs"
|
local docs="$project/docs"
|
||||||
if [[ ! -d "$docs" ]]; then
|
if [[ ! -d "$docs" ]]; then
|
||||||
if [[ -t 0 ]]; then
|
if [[ -t 0 ]] || [[ -e /dev/tty ]]; then
|
||||||
printf " ? no docs/ folder — create it? [y/N] "
|
printf " ? no docs/ folder — create it? [y/N] "
|
||||||
read -r answer
|
read -r answer </dev/tty
|
||||||
if [[ "${answer,,}" == "y" ]]; then
|
if [[ "${answer,,}" == "y" ]]; then
|
||||||
mkdir -p "$docs"
|
mkdir -p "$docs"
|
||||||
echo " ✓ created docs/"
|
echo " ✓ created docs/"
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user