-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild-debug.sh
More file actions
executable file
·60 lines (51 loc) · 1.49 KB
/
build-debug.sh
File metadata and controls
executable file
·60 lines (51 loc) · 1.49 KB
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#!/bin/bash
echo "🔧 构建Wails应用(调试模式)..."
# 清理缓存
echo "🧹 清理缓存..."
./clean-cache.sh
# 确保dist目录存在
echo "📁 准备前端文件..."
mkdir -p frontend/dist
# 复制前端文件
echo "📋 复制前端文件..."
cp -r frontend/src/* frontend/dist/ 2>/dev/null || true
# 复制wailsjs文件
echo "🔗 复制Wails JS文件..."
cp -r frontend/wailsjs frontend/dist/ 2>/dev/null || true
# 确保index.html存在
if [ ! -f "frontend/dist/index.html" ]; then
echo "📄 创建index.html..."
cat > frontend/dist/index.html << 'EOF'
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>ZipCracker - 压缩包密码破解工具</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<div id="app">
<!-- 应用内容将通过JavaScript动态生成 -->
</div>
<script type="module" src="main.js"></script>
</body>
</html>
EOF
fi
# 构建应用(调试模式)
echo "🏗️ 构建Go应用(调试模式)..."
go build -tags "wails dev" -gcflags "all=-N -l" -o zipcracker-debug
if [ $? -eq 0 ]; then
echo "✅ 调试构建成功!"
echo ""
echo "运行调试应用:"
echo "./zipcracker-debug"
echo ""
echo "或者使用VS Code调试器:"
echo "1. 按F5启动调试"
echo "2. 选择 'Debug Wails App' 或 'Debug Wails App (dev mode)'"
else
echo "❌ 调试构建失败!"
exit 1
fi