mirror of
https://github.com/BradGroux/veritas-kanban.git
synced 2026-08-28 02:44:59 +00:00
- Remove tracked personal attachment screenshots from git - Add tasks/attachments/ and tasks/archive-attachments/ to .gitignore - Create 4 example tasks showcasing features (auth, bug, research, automation) - Add seedIfEmpty() to TaskService for automatic first-run seeding - Add pnpm seed script for manual seeding - Update README quickstart with seed docs - Fix version badge mismatch (1.1.0 → 1.0.0)
41 lines
1.3 KiB
Bash
Executable file
41 lines
1.3 KiB
Bash
Executable file
#!/usr/bin/env bash
|
||
# seed.sh — Populate the board with example tasks for first-time users.
|
||
# Usage: pnpm seed (or: bash scripts/seed.sh)
|
||
#
|
||
# Copies example tasks into tasks/active/ so new users see a populated board.
|
||
# Safe to re-run — skips if active tasks already exist.
|
||
|
||
set -euo pipefail
|
||
|
||
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
||
PROJECT_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
|
||
ACTIVE_DIR="$PROJECT_ROOT/tasks/active"
|
||
EXAMPLES_DIR="$PROJECT_ROOT/tasks/examples"
|
||
|
||
# Ensure directories exist
|
||
mkdir -p "$ACTIVE_DIR"
|
||
|
||
# Count existing active tasks (excluding .gitkeep)
|
||
EXISTING=$(find "$ACTIVE_DIR" -name "*.md" -type f 2>/dev/null | wc -l | tr -d ' ')
|
||
|
||
if [ "$EXISTING" -gt 0 ]; then
|
||
echo "ℹ️ Board already has $EXISTING active task(s). Skipping seed."
|
||
echo " To force: rm tasks/active/*.md && pnpm seed"
|
||
exit 0
|
||
fi
|
||
|
||
if [ ! -d "$EXAMPLES_DIR" ] || [ -z "$(ls "$EXAMPLES_DIR"/*.md 2>/dev/null)" ]; then
|
||
echo "⚠️ No example tasks found in tasks/examples/. Nothing to seed."
|
||
exit 1
|
||
fi
|
||
|
||
# Copy examples into active
|
||
COPIED=0
|
||
for f in "$EXAMPLES_DIR"/*.md; do
|
||
cp "$f" "$ACTIVE_DIR/"
|
||
COPIED=$((COPIED + 1))
|
||
done
|
||
|
||
echo "✅ Seeded $COPIED example task(s) into tasks/active/"
|
||
echo " Start the server with: pnpm dev"
|
||
echo " Clear them anytime: rm tasks/active/task_example_*.md"
|