Compare commits

...

1 Commits

Author SHA1 Message Date
Edward Frazer
cdaeb1a8d5 fix: add noninteractive install script mode 2026-05-07 11:25:09 -07:00
2 changed files with 11 additions and 0 deletions

View File

@@ -27,6 +27,10 @@ function Prompt-YesNo {
[string]$Prompt
)
if ($env:CODEX_INSTALL_SCRIPT_NONINTERACTIVE -eq "true") {
return $false
}
if ([Console]::IsInputRedirected -or [Console]::IsOutputRedirected) {
return $false
}

View File

@@ -60,6 +60,9 @@ parse_args() {
--help | -h)
cat <<EOF
Usage: install.sh [--release VERSION]
Environment:
CODEX_INSTALL_SCRIPT_NONINTERACTIVE=true Skip prompts and use default answers.
EOF
exit 0
;;
@@ -488,6 +491,10 @@ classify_existing_codex() {
prompt_yes_no() {
prompt="$1"
if [ "${CODEX_INSTALL_SCRIPT_NONINTERACTIVE:-}" = "true" ]; then
return 1
fi
if ( : </dev/tty ) 2>/dev/null; then
printf '%s [y/N] ' "$prompt" >/dev/tty
if ! IFS= read -r answer </dev/tty; then