@echo off
REM Set Go environment variables
set CGO_ENABLED=0
set GOOS=linux
set GOARCH=arm
set GOARM=7
REM Compile the Go program
echo Compiling Go program...
go build -ldflags "-s -w"
REM Check if the compilation was successful
IF ERRORLEVEL 1 (
echo Compilation failed, please check the code.
pause
exit /B 1
)
echo Compilation successful, packing files...
REM Use 7-Zip to package files
"C:\Program Files\7-Zip\7z.exe" a bin\tboxconfig_arm7.tar tboxconfig wwwroot config.json
IF ERRORLEVEL 1 (
echo Packaging failed, please check if the folder and files exist.
pause
exit /B 1
)
echo Packaging successful, generated file is tboxconfig_arm7.zip
pause
exit /B 0
|
所有评论(0)