fix ghost terminal

This commit is contained in:
Louis Mazin 2026-06-28 19:11:13 +02:00
parent 51ef3b40ec
commit a94404e141

View File

@ -41,13 +41,40 @@ if not exist "%ENV_PATH%\Scripts" (
"%PYTHON_EXEC%" -m venv "%ENV_PATH%"
echo [INFO] Installation des dépendances...
"%ENV_PATH%\Scripts\python" -m pip install --upgrade pip
"%ENV_PATH%\Scripts\pip" install -r "%REQUIREMENTS%"
"%ENV_PATH%\Scripts\python" -m pip install -r "%REQUIREMENTS%"
) else (
echo [INFO] Environnement virtuel trouvé.
)
REM Activate and launch VS Code
echo [INFO] Lancement de VS Code...
call "%ENV_PATH%/Scripts/activate.bat"
start code "%ROOT_DIR%"
exit /b 0
set "CODE_EXE="
for /f "delims=" %%i in ('where code 2^>nul') do (
set "CODE_CMD=%%~fi"
goto :found
)
echo [ERROR] VS Code CLI not found.
exit /b 1
:found
for %%i in ("%CODE_CMD%") do (
set "CODE_BIN=%%~dpi"
)
for %%i in ("%CODE_BIN%..") do (
set "VSCODE_ROOT=%%~fi"
)
set "CODE_EXE=%VSCODE_ROOT%\Code.exe"
if exist "%CODE_EXE%" (
start "" "%CODE_EXE%" "%ROOT_DIR%"
) else (
start "" code "%ROOT_DIR%"
)
exit