forked from snsogbl/clip-save
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathclean.sh
More file actions
executable file
·49 lines (40 loc) · 1.15 KB
/
clean.sh
File metadata and controls
executable file
·49 lines (40 loc) · 1.15 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
#!/bin/bash
# 剪存项目清理脚本
# 用于清理构建产物和临时文件
echo "🧹 开始清理剪存项目..."
# 清理前端构建产物
if [ -d "frontend/dist" ]; then
echo "删除前端构建产物..."
rm -rf frontend/dist
fi
# 清理前端依赖(可选,需要重新安装)
if [ "$1" = "--deep" ]; then
if [ -d "frontend/node_modules" ]; then
echo "删除前端依赖..."
rm -rf frontend/node_modules
fi
echo "请运行 'cd frontend && npm install' 重新安装依赖"
fi
# 清理应用构建产物
if [ -d "build/bin" ]; then
echo "删除应用构建产物..."
rm -rf build/bin
fi
# 清理 Go 模块缓存(可选)
if [ "$1" = "--deep" ]; then
echo "清理 Go 模块缓存..."
go clean -modcache
fi
if [ -f "剪存.pkg" ]; then
echo "删除剪存.pkg..."
rm -f 剪存.pkg
fi
# 清理临时文件
find . -name "*.tmp" -delete 2>/dev/null
find . -name "*.log" -delete 2>/dev/null
find . -name ".DS_Store" -delete 2>/dev/null
echo "✅ 清理完成!"
echo ""
echo "使用方法:"
echo " ./clean.sh - 清理构建产物"
echo " ./clean.sh --deep - 深度清理(包括依赖)"