-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.sh
More file actions
43 lines (35 loc) · 1019 Bytes
/
build.sh
File metadata and controls
43 lines (35 loc) · 1019 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/bin/bash
echo "=============================================="
echo " 开始一键打包:Rust后端 + 前端网页"
echo "=============================================="
rm ./dist -rf
# 1. 打包 Rust
echo "[1/4] 打包 Rust 后端..."
cd server
cargo build --release
cd ..
# 2. 打包前端
echo "[2/4] 打包前端..."
cd client
pnpm build
cd ..
# 3. 重建 dist
echo "[3/4] 重建 dist 目录..."
rm -rf dist
mkdir -p dist/web
# 4. 复制文件
echo "[4/4] 复制文件..."
cp server/target/release/remote-computer dist/
cp server/cert.pem dist/
cp server/key.pem dist/
cp server/config.toml dist/
cp -r client/apps/web/dist/* dist/web/
cp install.sh dist/
# 5. 压缩包,把dist内的文件夹和文件压缩成remote-computer.zip,放在dist目录中,打包最小化
echo "打包压缩..."
cd dist
zip -r remote-computer.zip *
echo ""
echo "=============================================="
echo " ✅ 打包完成!产物在 dist 文件夹"
echo "=============================================="