parent
8dbfaae1b6
commit
59e0ee33a5
2 changed files with 27 additions and 15 deletions
11
run.bat
11
run.bat
|
@ -42,21 +42,12 @@ exit /b 1
|
|||
rem Use the current directory where the script is executed
|
||||
pushd %~dp0
|
||||
|
||||
rem Collect all .go files in the current directory excluding *_test.go
|
||||
set GO_FILES=
|
||||
for %%f in (*.go) do (
|
||||
echo %%f | findstr "_test.go" >nul
|
||||
if errorlevel 1 (
|
||||
set GO_FILES=!GO_FILES! %%f
|
||||
)
|
||||
)
|
||||
|
||||
rem Always delete and rebuild the binary
|
||||
echo Cleaning previous build...
|
||||
if exist "%BUILD_OUTPUT%" del "%BUILD_OUTPUT%"
|
||||
|
||||
echo Building application...
|
||||
go build -o "%BUILD_OUTPUT%" !GO_FILES!
|
||||
go build -ldflags="-s -w" -o "%BUILD_OUTPUT%" .
|
||||
if errorlevel 1 (
|
||||
echo Build failed!
|
||||
exit /b 1
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue