mirror of
https://github.com/openai/codex.git
synced 2026-10-21 17:48:44 +00:00
fix: run standalone updates noninteractively
This commit is contained in:
@@ -14,9 +14,9 @@ pub enum UpdateAction {
|
||||
BunGlobalLatest,
|
||||
/// Update via `brew upgrade codex`.
|
||||
BrewUpgrade,
|
||||
/// Update via `curl -fsSL https://chatgpt.com/codex/install.sh | sh`.
|
||||
/// Update via `curl -fsSL https://chatgpt.com/codex/install.sh | CODEX_NON_INTERACTIVE=1 sh`.
|
||||
StandaloneUnix,
|
||||
/// Update via `irm https://chatgpt.com/codex/install.ps1|iex`.
|
||||
/// Update via `$env:CODEX_NON_INTERACTIVE='1'; irm https://chatgpt.com/codex/install.ps1 | iex`.
|
||||
StandaloneWindows,
|
||||
}
|
||||
|
||||
@@ -43,7 +43,10 @@ impl UpdateAction {
|
||||
UpdateAction::BrewUpgrade => ("brew", &["upgrade", "--cask", "codex"]),
|
||||
UpdateAction::StandaloneUnix => (
|
||||
"sh",
|
||||
&["-c", "curl -fsSL https://chatgpt.com/codex/install.sh | sh"],
|
||||
&[
|
||||
"-c",
|
||||
"curl -fsSL https://chatgpt.com/codex/install.sh | CODEX_NON_INTERACTIVE=1 sh",
|
||||
],
|
||||
),
|
||||
UpdateAction::StandaloneWindows => (
|
||||
"powershell",
|
||||
@@ -51,7 +54,7 @@ impl UpdateAction {
|
||||
"-ExecutionPolicy",
|
||||
"Bypass",
|
||||
"-c",
|
||||
"irm https://chatgpt.com/codex/install.ps1 | iex",
|
||||
"$env:CODEX_NON_INTERACTIVE='1'; irm https://chatgpt.com/codex/install.ps1 | iex",
|
||||
],
|
||||
),
|
||||
}
|
||||
@@ -140,7 +143,10 @@ mod tests {
|
||||
UpdateAction::StandaloneUnix.command_args(),
|
||||
(
|
||||
"sh",
|
||||
&["-c", "curl -fsSL https://chatgpt.com/codex/install.sh | sh"][..],
|
||||
&[
|
||||
"-c",
|
||||
"curl -fsSL https://chatgpt.com/codex/install.sh | CODEX_NON_INTERACTIVE=1 sh"
|
||||
][..],
|
||||
)
|
||||
);
|
||||
assert_eq!(
|
||||
@@ -151,7 +157,7 @@ mod tests {
|
||||
"-ExecutionPolicy",
|
||||
"Bypass",
|
||||
"-c",
|
||||
"irm https://chatgpt.com/codex/install.ps1 | iex"
|
||||
"$env:CODEX_NON_INTERACTIVE='1'; irm https://chatgpt.com/codex/install.ps1 | iex"
|
||||
][..],
|
||||
)
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user