Files
Portfolio/.auto-claude/specs/021-document-the-scripts-directory-utilities-for-devel/init.sh
T
2026-01-25 19:39:30 +01:00

83 lines
2.0 KiB
Bash

#!/bin/bash
# Auto-Build Environment Setup
# Generated by Planner Agent for Task 021
set -e
echo "========================================"
echo "Starting Development Environment"
echo "========================================"
# Colors
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
NC='\033[0m'
# Wait for service function
wait_for_service() {
local port=$1
local name=$2
local max=30
local count=0
echo "Waiting for $name on port $port..."
while ! nc -z localhost $port 2>/dev/null; do
count=$((count + 1))
if [ $count -ge $max ]; then
echo -e "${RED}$name failed to start${NC}"
return 1
fi
sleep 1
done
echo -e "${GREEN}$name ready${NC}"
}
# ============================================
# DOCUMENTATION TASK - NO SERVICES TO START
# ============================================
echo ""
echo "This is a documentation-only task."
echo "No services need to be started."
echo ""
echo "The task will:"
echo " 1. Create scripts/README.md"
echo " 2. Update main README.md"
echo " 3. Update package.json with script aliases"
echo " 4. Document missing scripts"
echo ""
# ============================================
# OPTIONAL: Start dev server for testing
# ============================================
read -p "Do you want to start the Next.js dev server? (y/n) " -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]
then
echo "Starting Next.js development server..."
npm run dev &
wait_for_service 3000 "Next.js"
echo ""
echo "========================================"
echo "Environment Ready!"
echo "========================================"
echo ""
echo "Services:"
echo " Next.js: http://localhost:3000"
echo ""
else
echo ""
echo "========================================"
echo "Ready to document scripts!"
echo "========================================"
echo ""
fi
echo "To continue building this spec, run:"
echo " source auto-claude/.venv/bin/activate && python auto-claude/run.py --spec 021"
echo ""