codex 설치 오류
This commit is contained in:
1 parent
f883330a45
commit
6e1aa7d4b4
1 file changed
+19
-10
+19
-10
@@ -48,24 +48,33 @@ function Main {
|
||||
Write-Info "===== Codex CLI install script (Windows PowerShell) ====="
|
||||
Write-Info "Installing OpenAI Codex CLI natively..."
|
||||
|
||||
try {
|
||||
Write-Info "Fetching and executing official installer from: https://chatgpt.com/codex/install.ps1"
|
||||
$tmpDir = Join-Path $env:TEMP "codex_install_$(Get-Random)"
|
||||
New-Item -ItemType Directory -Path $tmpDir -Force | Out-Null
|
||||
$scriptPath = Join-Path $tmpDir "install.ps1"
|
||||
|
||||
# 공식 설치 ps1 스크립트를 다운로드 및 메모리 상에서 직접 호출 가동
|
||||
$installerScript = Invoke-RestMethod -Uri "https://chatgpt.com/codex/install.ps1" -UseBasicParsing
|
||||
Invoke-Expression $installerScript
|
||||
try {
|
||||
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
|
||||
Reference in new issue
Block a user