-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathuvw.bat
More file actions
30 lines (23 loc) · 921 Bytes
/
uvw.bat
File metadata and controls
30 lines (23 loc) · 921 Bytes
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
rem Simple uv wrapper for Windows that auto-installs uv locally if needed
set UV_DIR=%cd%\.uv
set UV_BIN=%UV_DIR%\uv.exe
rem Install uv locally if not present
if not exist "%UV_BIN%" (
echo Installing uv locally to %UV_DIR%...
rem Use uv's official installation script with custom install location
set UV_UNMANAGED_INSTALL=%UV_DIR%
rem Use pwsh if available, because legacy powershell causes problems when launched from pwsh!
where pwsh >nul 2>&1
if %errorlevel% equ 0 (
pwsh -NoProfile -ExecutionPolicy ByPass -Command "iwr -useb https://astral.sh/uv/install.ps1 | iex"
) else (
powershell -NoProfile -ExecutionPolicy ByPass -Command "iwr -useb https://astral.sh/uv/install.ps1 | iex"
)
if not exist "%UV_BIN%" (
echo Failed to install uv
exit /b 1
)
)
rem Execute uv with all arguments
"%UV_BIN%" %*