-
Notifications
You must be signed in to change notification settings - Fork 172
/
build.bat
29 lines (23 loc) · 820 Bytes
/
build.bat
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
@echo off
SETLOCAL EnableDelayedExpansion
if not exist "%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" (
echo "WARNING: You need VS 2022 (for vswhere.exe)"
)
set vswherestr=^"!ProgramFiles(x86)!\Microsoft Visual Studio\Installer\vswhere.exe^" -latest -products * -requires Microsoft.Component.MSBuild -property installationPath
for /f "usebackq tokens=*" %%i in (`!vswherestr!`) do (
set BUILDVCTOOLS=%%i\Common7\IDE
echo BUILDVCTOOLS: !BUILDVCTOOLS!
if not exist !BUILDVCTOOLS!\devenv.com (
echo Error: Cannot find VS2022
exit /b 2
)
git pull
git submodule init
git submodule update
echo.!BUILDVCTOOLS! | findstr /C:"2022" >nul &&(
"!BUILDVCTOOLS!\devenv.com" "Server.sln" /Rebuild "Release"
) || (
echo Error: Cannot find vs2022
exit /b 2
)
)