~kris/dots

srice

ref: b42b72dc2648499470b89418ac629e40f41d3149 srice/.local/bin/blog-draft-index -rwxr-xr-x 524 bytes
b42b72dc — Kris Yotam sb-battery: match macsmc-battery by type, add low-battery dunst alerts; xprofile: caps:super 2 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