diff --git a/.gitignore b/.gitignore index 108584f..7316aa6 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ *.skill +dist/ diff --git a/package_all.sh b/package_all.sh new file mode 100755 index 0000000..81913ee --- /dev/null +++ b/package_all.sh @@ -0,0 +1,27 @@ +#!/usr/bin/env bash +# Packages all skills in /data/skills/ into .skill zip files in /data/skills/dist/ +set -e + +SKILLS_DIR="/data/skills" +DIST_DIR="/data/skills/dist" +mkdir -p "$DIST_DIR" + +cd "$SKILLS_DIR" + +for skill_dir in */; do + skill_name="${skill_dir%/}" + # Skip non-skill directories + if [ ! -f "$skill_dir/SKILL.md" ]; then + continue + fi + output="$DIST_DIR/${skill_name}.skill" + echo "Packaging $skill_name -> $output" + # .skill files are just zips of the skill directory + cd "$SKILLS_DIR" + zip -r "$output" "$skill_dir" -x "*.pyc" -x "__pycache__/*" > /dev/null + echo " Done: $(du -h "$output" | cut -f1)" +done + +echo "All skills packaged in $DIST_DIR" +ls -lh "$DIST_DIR" +