-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy pathpackage-skills.sh
More file actions
executable file
·56 lines (48 loc) · 1.27 KB
/
Copy pathpackage-skills.sh
File metadata and controls
executable file
·56 lines (48 loc) · 1.27 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
#!/bin/bash
# Skills 打包脚本
# 为每个 Skill 创建单独的 ZIP 压缩包
echo "开始打包 Skills..."
echo ""
# 定义 Skills 列表
SKILLS=(
"gaokao-science-tutor"
"gaokao-liberal-arts-tutor"
"gaokao-chinese-tutor"
"gaokao-english-tutor"
"gaokao-general-tech-tutor"
)
# 计数器
SUCCESS=0
TOTAL=${#SKILLS[@]}
# 为每个 Skill 创建 ZIP 包
for skill in "${SKILLS[@]}"; do
if [ -d "$skill" ]; then
echo "正在打包: $skill"
zip -r -q "${skill}.zip" "$skill/"
if [ $? -eq 0 ]; then
SIZE=$(du -h "${skill}.zip" | cut -f1)
echo "✅ 成功: ${skill}.zip (${SIZE})"
((SUCCESS++))
else
echo "❌ 失败: $skill"
fi
echo ""
else
echo "⚠️ 警告: 目录 $skill 不存在"
echo ""
fi
done
echo "================================"
echo "打包完成: $SUCCESS/$TOTAL"
echo "================================"
echo ""
# 列出生成的文件
if [ $SUCCESS -gt 0 ]; then
echo "生成的 ZIP 文件:"
ls -lh *.zip 2>/dev/null | awk '{print $9, "("$5")"}'
echo ""
echo "这些文件可以直接上传到 Skill 商城。"
echo "详见 PACKAGING.md 了解更多信息。"
else
echo "没有成功打包任何 Skill。"
fi