From 6e1aa7d4b44246e98493dbb3fbc84ecb92bb931e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=B1=84=EB=AC=B8=EC=B0=BD=40MBA?= Date: Wed, 9 Sep 2026 13:23:38 +0900 Subject: [PATCH] =?UTF-8?q?codex=20=EC=84=A4=EC=B9=98=20=EC=98=A4=EB=A5=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- install-codex-cli.ps1 | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/install-codex-cli.ps1 b/install-codex-cli.ps1 index 9645ddc..92fe46c 100644 --- a/install-codex-cli.ps1 +++ b/install-codex-cli.ps1 @@ -48,24 +48,33 @@ function Main { Write-Info "===== Codex CLI install script (Windows PowerShell) =====" Write-Info "Installing OpenAI Codex CLI natively..." + $tmpDir = Join-Path $env:TEMP "codex_install_$(Get-Random)" + New-Item -ItemType Directory -Path $tmpDir -Force | Out-Null + $scriptPath = Join-Path $tmpDir "install.ps1" + try { - Write-Info "Fetching and executing official installer from: https://chatgpt.com/codex/install.ps1" - - # 공식 설치 ps1 스크립트를 다운로드 및 메모리 상에서 직접 호출 가동 - $installerScript = Invoke-RestMethod -Uri "https://chatgpt.com/codex/install.ps1" -UseBasicParsing - Invoke-Expression $installerScript + Write-Info "Downloading official installer from: https://releases.openai.com/codex/install.ps1" + $ProgressPreference = 'SilentlyContinue' + Invoke-WebRequest -Uri "https://releases.openai.com/codex/install.ps1" -OutFile $scriptPath -UseBasicParsing + $ProgressPreference = 'Continue' + + if (-not (Test-Path $scriptPath)) { + Write-Err "Failed to download official Codex CLI installer." + } + + Write-Info "Executing official Codex CLI installer..." + & $scriptPath Write-Success "Codex CLI has been successfully installed!" Write-Info "Please restart your terminal window or refresh your PATH environment variable." Write-Info "Run command: codex auth (to log in) and then 'codex' to start." } catch { Write-Err "Failed to install Codex CLI: $_" + } finally { + if (Test-Path $tmpDir) { + Remove-Item -Path $tmpDir -Recurse -Force -ErrorAction SilentlyContinue + } } } -# 예기치 못한 전체 프로세스 에러 감지를 위한 Trap 설정 -trap { - Write-Err "An unexpected error occurred during installation: $_" -} - Main