echo "🔍 Running pre-commit checks..." # Run lint echo "📋 Running lint..." pnpm run lint if [ $? -ne 0 ]; then echo "❌ Lint failed" exit 1 fi # Run format echo "🎨 Running format..." pnpm run format if [ $? -ne 0 ]; then echo "❌ Format failed" exit 1 fi # Run format:code echo "🎨 Running format:code..." pnpm run format:code if [ $? -ne 0 ]; then echo "❌ Format:code failed" exit 1 fi # Run format:imports echo "📦 Running format:imports..." pnpm run format:imports if [ $? -ne 0 ]; then echo "❌ Format:imports failed" exit 1 fi # Run check echo "✅ Running check..." pnpm run check if [ $? -ne 0 ]; then echo "❌ Check failed" exit 1 fi # Check if dist directory exists before running lychee if [ -d "dist" ]; then echo "🔗 Running lychee check on dist directory..." lychee src/content --no-progress --exclude-private --max-retries 1 --timeout 10 if [ $? -ne 0 ]; then echo "⚠️ Lychee found broken links (this won't block the commit)" fi else echo "⚠️ Dist directory not found, skipping lychee check" fi echo "✅ All pre-commit checks passed!"