#!/bin/zsh

set -euo pipefail

ROOT_DIR="$(cd "$(dirname "$0")" && pwd)"
PROJECT_NAME="$(basename "$ROOT_DIR")"
TIMESTAMP="$(date +"%Y%m%d_%H%M%S")"
OUTPUT_NAME="${1:-${PROJECT_NAME}_${TIMESTAMP}.zip}"

cd "$ROOT_DIR"

zip -r "$OUTPUT_NAME" . \
  -x "docs/*" \
  -x "examples/*" \
  -x "projects/*" \
  -x ".venv/*" \
  -x ".venv-ppt/*" \
  -x "*.DS_Store" \
  -x "*/.DS_Store"

printf 'Created: %s/%s\n' "$ROOT_DIR" "$OUTPUT_NAME"
