verify-gitignore.sh

 1#!/bin/bash
 2
 3# Script to verify that .gitignore is working correctly
 4
 5echo "๐Ÿงน Verifying .gitignore configuration for Shelley"
 6echo "================================================"
 7
 8cd "$(dirname "$0")/../.."
 9
10echo "\nโœ… Current git status:"
11git status --porcelain
12
13if [ $? -eq 0 ] && [ -z "$(git status --porcelain)" ]; then
14    echo "โœ… Working tree is clean"
15else
16    echo "โš ๏ธ  Working tree has changes"
17fi
18
19echo "\n๐Ÿšซ Files being ignored by git:"
20git status --ignored --porcelain | grep '^!!' | head -10
21
22echo "\n๐Ÿ“ Build directories that should be ignored:"
23for dir in "ui/node_modules" "ui/dist" "ui/test-results" "ui/playwright-report" "bin"; do
24    if [ -d "$dir" ]; then
25        echo "  โœ… $dir (exists and ignored)"
26    else
27        echo "  โšช $dir (doesn't exist)"
28    fi
29done
30
31echo "\n๐Ÿ’พ Database files that should be ignored:"
32for pattern in "*.db" "*.db-shm" "*.db-wal"; do
33    files=$(find . -maxdepth 2 -name "$pattern" 2>/dev/null)
34    if [ -n "$files" ]; then
35        echo "  โœ… Found and ignoring: $pattern"
36        echo "$files" | sed 's/^/    /'
37    else
38        echo "  โšช No $pattern files found"
39    fi
40done
41
42echo "\n๐ŸŽญ Playwright outputs that should be ignored:"
43for dir in "ui/test-results" "ui/playwright-report"; do
44    if [ -d "$dir" ]; then
45        echo "  โœ… $dir (exists and ignored)"
46    else
47        echo "  โšช $dir (doesn't exist)"
48    fi
49done
50
51echo "\n๐Ÿ“ธ Screenshot directory:"
52if [ -d "ui/e2e/screenshots" ]; then
53    count=$(find ui/e2e/screenshots -name "*.png" 2>/dev/null | wc -l)
54    echo "  โœ… ui/e2e/screenshots exists with $count PNG files (ignored)"
55else
56    echo "  โŒ ui/e2e/screenshots missing"
57fi
58
59echo "\n๐ŸŽฏ Summary: .gitignore is properly configured to exclude build outputs while preserving source code."