Files
q-blog/scripts/dev/phase1/list-imgs-missing-alt.sh
2025-08-16 23:31:26 -04:00

8 lines
397 B
Bash
Executable File

#!/usr/bin/env bash
# Lists <img> tags likely missing alt= attribute (heuristic).
set -euo pipefail
ROOT="$(git rev-parse --show-toplevel 2>/dev/null || echo .)"
OUT="$ROOT/reports/phase1-$(date +%Y%m%d-%H%M%S)-img-no-alt.txt"
grep -RIn --include='*.{tsx,jsx,ts,js}' '<img\b' "$ROOT/src" | awk -F: '{path=$1;line=$2;rest=$0; if (rest !~ /alt=/) print $0}' | tee "$OUT" || true
echo "Wrote $OUT"