Add Windows wrappers for ./y

This commit is contained in:
Simon Buchan 2023-11-27 21:41:13 +13:00
parent 6b82fe231d
commit 62dbc19425
2 changed files with 21 additions and 0 deletions

9
y.cmd Normal file
View File

@ -0,0 +1,9 @@
@echo off
echo [BUILD] build system >&2
mkdir build 2>nul
rustc build_system/main.rs -o build\y.exe -Cdebuginfo=1 --edition 2021 || goto :error
build\y.exe %* || goto :error
goto :EOF
:error
exit /b

12
y.ps1 Normal file
View File

@ -0,0 +1,12 @@
$ErrorActionPreference = "Stop"
$host.ui.WriteErrorLine("[BUILD] build system")
New-Item -ItemType Directory -Force -Path build | Out-Null
& rustc build_system/main.rs -o build\y.exe -Cdebuginfo=1 --edition 2021
if ($LASTEXITCODE -ne 0) {
exit $LASTEXITCODE
}
& build\y.exe $args
if ($LASTEXITCODE -ne 0) {
exit $LASTEXITCODE
}