From a4bf5d2d5270badc200af66fc463effc34205c39 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E6=96=87=E5=B3=B0?= Date: Tue, 10 Feb 2026 12:33:24 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=9B=E5=BB=BA=E4=BB=85=E7=BC=96=E8=AF=91?= =?UTF-8?q?=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/.gitignore | 2 ++ backend/build.sh | 18 ++++++++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 backend/build.sh diff --git a/backend/.gitignore b/backend/.gitignore index 86fef7e..cb8585c 100644 --- a/backend/.gitignore +++ b/backend/.gitignore @@ -10,6 +10,8 @@ /data /tmp +/build + /test *.db diff --git a/backend/build.sh b/backend/build.sh new file mode 100644 index 0000000..8988b7a --- /dev/null +++ b/backend/build.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +APP_NAME="OPSYS" +APP_PATH="./build/$APP_NAME" + +# 编译应用 +echo "编译应用..." +CGO_ENABLED=0 GOOS=linux go build -o $APP_NAME -ldflags="-s -w" main.go + +# 创建目录 +echo "创建目录..." +sudo mkdir -p $APP_PATH + +# 复制文件 +echo "复制文件..." +sudo cp $APP_NAME $APP_PATH/ +sudo cp -r defConfig $APP_PATH/ +sudo cp -r dist $APP_PATH/