Compare commits

...

3 Commits

Author SHA1 Message Date
efrazer-oai
c3690e5bce fix: expose noninteractive installer flag 2026-05-21 17:59:01 -07:00
efrazer-oai
f3118243d6 fix: expose noninteractive installer flag 2026-05-21 17:57:43 -07:00
Edward Frazer
cdaeb1a8d5 fix: add noninteractive install script mode 2026-05-07 11:25:09 -07:00
2 changed files with 15 additions and 2 deletions

View File

@@ -1,5 +1,6 @@
param(
[string]$Release = "latest"
[string]$Release = "latest",
[switch]$NonInteractive
)
Set-StrictMode -Version Latest
@@ -27,6 +28,10 @@ function Prompt-YesNo {
[string]$Prompt
)
if ($NonInteractive) {
return $false
}
if ([Console]::IsInputRedirected -or [Console]::IsOutputRedirected) {
return $false
}

View File

@@ -3,6 +3,7 @@
set -eu
RELEASE="latest"
NON_INTERACTIVE=false
BIN_DIR="${CODEX_INSTALL_DIR:-$HOME/.local/bin}"
BIN_PATH="$BIN_DIR/codex"
@@ -57,9 +58,12 @@ parse_args() {
RELEASE="$2"
shift
;;
--non-interactive)
NON_INTERACTIVE=true
;;
--help | -h)
cat <<EOF
Usage: install.sh [--release VERSION]
Usage: install.sh [--release VERSION] [--non-interactive]
EOF
exit 0
;;
@@ -488,6 +492,10 @@ classify_existing_codex() {
prompt_yes_no() {
prompt="$1"
if [ "$NON_INTERACTIVE" = 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