Cubyz/run.bat
Samuel Meenzen 8aaa9f585c
Add run_release script (#152)
* Add run_release script

* Update README to use the run_release scripts
2023-10-24 15:43:17 +02:00

25 lines
897 B
Batchfile

@echo off
set /p baseVersion=<".zig-version"
set version=zig-windows-x86_64-%baseVersion%
if not exist compiler mkdir compiler
if not exist compiler\version.txt copy NUL compiler\version.txt >NUL
set currVersion=
set /p currVersion=<"compiler\version.txt"
if not "%version%" == "%currVersion%" (
echo Deleting old zig installation ...
if exist compiler\zig rmdir /s /q compiler\zig
echo Downloading zig version %version% ...
powershell -Command $ProgressPreference = 'SilentlyContinue'; "Invoke-WebRequest -uri https://ziglang.org/builds/%version%.zip -OutFile compiler\archive.zip"
echo Extracting zip file ...
powershell $ProgressPreference = 'SilentlyContinue'; Expand-Archive compiler\archive.zip -DestinationPath compiler
ren compiler\%version% zig
echo Done.
del compiler\archive.zip
echo %version%> compiler\version.txt
)
compiler\zig\zig build run %*