22 lines
393 B
Batchfile
22 lines
393 B
Batchfile
@echo off
|
|
setlocal
|
|
|
|
where go.exe >nul 2>&1
|
|
if errorlevel 1 (
|
|
echo Go was not found in PATH.
|
|
exit /b 1
|
|
)
|
|
|
|
pushd "%~dp0" || exit /b 1
|
|
go build -trimpath -ldflags "-s -w -H=windowsgui" -o start.exe start.go
|
|
set "BUILD_EXIT=%errorlevel%"
|
|
popd
|
|
|
|
if not "%BUILD_EXIT%"=="0" (
|
|
echo Failed to build start.exe.
|
|
exit /b %BUILD_EXIT%
|
|
)
|
|
|
|
echo Built "%~dp0start.exe" successfully.
|
|
exit /b 0
|