From 10419f9bb89932bdb7680647e54c8e73af7e664c Mon Sep 17 00:00:00 2001 From: Sun Date: Mon, 10 Apr 2023 13:52:40 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=20windows=E7=BC=96=E8=AF=91?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=89=93=E5=8C=85=E7=BC=96=E8=AF=91=E6=96=87?= =?UTF-8?q?=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build.bat | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/build.bat b/build.bat index 28a6845..d9bddc4 100644 --- a/build.bat +++ b/build.bat @@ -1,8 +1,23 @@ +@REM 请提前搭建好node.js环境和go环境 +@REM 请将前端项目文件拉取到本目录中,并将项目文件夹重命名为web + +set filenameZip=li-calendar_windows.zip +set filename=li-calendar.exe cd web call npm run build rd ..\assets\frontend xcopy .\dist\ ..\assets\frontend /s /i /y cd ..\ go-bindata-assetfs -o=assets/bindata.go -pkg=assets assets/... -go build -o li-calendar.exe --ldflags="-X main.RunMode=release" main.go -echo "li-calendar.exe compilation is complete!" \ No newline at end of file +go build -o %filename% --ldflags="-X main.RunMode=release" main.go + + +REM 打包文件 +powershell Compress-Archive %filename% %filenameZip% + +REM 删除原始文件 +del %filename% + +REM 返回上一级目录,进入父文件夹 +cd .. +echo "%filenameZip% compilation is complete!" \ No newline at end of file