feat: add source export script and clean up .DS_Store tracking

Add scripts/export_source.sh to export project source to dist-source/,
add .DS_Store and dist-source/ to .gitignore, remove tracked .DS_Store.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-04-21 18:27:24 +08:00
parent 7f52375115
commit c5897e5d0d
3 changed files with 31 additions and 0 deletions

2
.gitignore vendored
View File

@@ -1,8 +1,10 @@
__pycache__/
*.pyc
.DS_Store
.venv/
*.egg-info/
dist/
build/
backups/
scan/
dist-source/

BIN
docs/.DS_Store vendored

Binary file not shown.

29
scripts/export_source.sh Executable file
View File

@@ -0,0 +1,29 @@
#!/usr/bin/env bash
# Export project source code to dist-source/ directory.
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
PROJECT_DIR="$(cd "$SCRIPT_DIR/.." && pwd)"
DIST_DIR="$PROJECT_DIR/dist-source"
rm -rf "$DIST_DIR"
mkdir -p "$DIST_DIR"
# Copy project source and config files
cp "$PROJECT_DIR/pyproject.toml" "$DIST_DIR/"
cp "$PROJECT_DIR/uv.lock" "$DIST_DIR/"
cp "$PROJECT_DIR/README.md" "$DIST_DIR/"
cp "$PROJECT_DIR/CLAUDE.md" "$DIST_DIR/" 2>/dev/null || true
# Copy directories
for dir in src scripts docs; do
if [ -d "$PROJECT_DIR/$dir" ]; then
cp -r "$PROJECT_DIR/$dir" "$DIST_DIR/"
fi
done
# Remove __pycache__ from exported source
find "$DIST_DIR" -type d -name "__pycache__" -exec rm -rf {} + 2>/dev/null || true
find "$DIST_DIR" -name ".DS_Store" -delete 2>/dev/null || true
echo "Exported to $DIST_DIR/"