-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlaunch-codex.bat
More file actions
30 lines (27 loc) · 1.09 KB
/
launch-codex.bat
File metadata and controls
30 lines (27 loc) · 1.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
@echo off
setlocal EnableDelayedExpansion
title Codex Desktop for Windows
cd /d "%~dp0"
:: Find codex.exe
set "CODEX_EXE="
for /f "tokens=*" %%r in ('npm.cmd root -g 2^>nul') do set "NPM_ROOT=%%r"
if defined NPM_ROOT (
if exist "%NPM_ROOT%\@openai\codex\node_modules\@openai\codex-win32-x64\vendor\x86_64-pc-windows-msvc\codex\codex.exe" (
set "CODEX_EXE=%NPM_ROOT%\@openai\codex\node_modules\@openai\codex-win32-x64\vendor\x86_64-pc-windows-msvc\codex\codex.exe"
)
if not defined CODEX_EXE (
if exist "%NPM_ROOT%\@openai\codex\vendor\x86_64-pc-windows-msvc\codex\codex.exe" (
set "CODEX_EXE=%NPM_ROOT%\@openai\codex\vendor\x86_64-pc-windows-msvc\codex\codex.exe"
)
)
)
if defined CODEX_EXE (
powershell -NoProfile -ExecutionPolicy Bypass -File "%~dp0scripts\run.ps1" -DmgPath "%~dp0Codex.dmg" -Reuse -CodexCliPath "%CODEX_EXE%"
) else (
powershell -NoProfile -ExecutionPolicy Bypass -File "%~dp0scripts\run.ps1" -DmgPath "%~dp0Codex.dmg" -Reuse
)
if %errorlevel% neq 0 (
echo.
echo Codex exited with an error. Check output above.
pause
)