diff --git a/scripts/install/install.ps1 b/scripts/install/install.ps1 index 6d7bc00393..e6e6286008 100644 --- a/scripts/install/install.ps1 +++ b/scripts/install/install.ps1 @@ -1,5 +1,5 @@ param( - [string]$Release = "latest", + [string]$Release = $env:CODEX_RELEASE, [switch]$NonInteractive ) @@ -7,6 +7,14 @@ Set-StrictMode -Version Latest $ErrorActionPreference = "Stop" $ProgressPreference = "SilentlyContinue" +if ([string]::IsNullOrWhiteSpace($Release)) { + $Release = "latest" +} + +if (-not $PSBoundParameters.ContainsKey("NonInteractive") -and $env:CODEX_NON_INTERACTIVE -match "^(?i:1|true|yes)$") { + $NonInteractive = $true +} + function Write-Step { param( [string]$Message diff --git a/scripts/install/install.sh b/scripts/install/install.sh index 3e225a815d..a7260f9bca 100755 --- a/scripts/install/install.sh +++ b/scripts/install/install.sh @@ -2,8 +2,8 @@ set -eu -RELEASE="latest" -NON_INTERACTIVE=false +RELEASE="${CODEX_RELEASE:-latest}" +NON_INTERACTIVE="${CODEX_NON_INTERACTIVE:-false}" BIN_DIR="${CODEX_INSTALL_DIR:-$HOME/.local/bin}" BIN_PATH="$BIN_DIR/codex" @@ -64,6 +64,10 @@ parse_args() { --help | -h) cat </dev/null; then printf '%s [y/N] ' "$prompt" >/dev/tty