Merge pull request #1432 from simonbuchan/windows-y-wrappers

Add Windows wrappers for ./y
This commit is contained in:
bjorn3 2023-11-29 13:43:39 +01:00 committed by GitHub
commit db91a41537
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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
}