~kris/dots

srice

ref: 4471d164e01750db50f2d73d2a7c8af0e2318591 srice/.local/bin/blog-draft-index -rwxr-xr-x 524 bytes
4471d164 — Kris Yotam wallpapermenu: pass -no-config so ambient rofi theme can't override the picker 3 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
#!/usr/bin/env sh
set -eu

find . \( -path '*/.git' -o -path '*/node_modules' -o -path '*/.next' -o -path '*/_site' \) -prune -o -type f \( -path '*/drafts/*' -o -name '*draft*.md' -o -name '*draft*.mdx' \) -print |
while IFS= read -r f; do
  words=$(wc -w < "$f" | tr -d ' ')
  title=$(sed -n -e 's/^title:[[:space:]]*//p' -e 's/^# //p' "$f" | sed -n '1p')
  todos=$(rg -c 'TK|TODO|FIXME|XXX|SOURCE\?' "$f" 2>/dev/null || true)
  printf '%7s words  %3s flags  %s  %s\n' "$words" "${todos:-0}" "$f" "$title"
done | sort -nr