@echo off
setlocal
cd /d "%~dp0"
where go >nul 2>nul
if errorlevel 1 goto :NO_GO
echo [1/3] go test ./...
go test ./...
if errorlevel 1 goto :FAIL
echo [2/3] go vet ./...
go vet ./...
if errorlevel 1 goto :FAIL
echo [3/3] go build
go build -trimpath -ldflags "-H=windowsgui -s -w" -o "..\FakeStash_Installer.exe" .
if errorlevel 1 goto :FAIL
echo Build complete: ..\FakeStash_Installer.exe
pause
exit /b 0
:NO_GO
echo Go was not found in PATH.
pause
exit /b 1
:FAIL
echo Build failed.
pause
exit /b 1
