← back to Parked Landers

finish.sh

19 lines

#!/bin/bash
cd "$HOME/Projects/parked-landers"
log="gen-images.log"
# wait up to ~12 min for the batch to finish
for i in $(seq 1 144); do
  grep -q '^DONE' "$log" 2>/dev/null && break
  sleep 5
done
echo "=== batch log tail ==="; tail -3 "$log"
imgs=$(find sites -name '*.jpg' | wc -l | tr -d ' ')
echo "images on disk: $imgs/48"
echo "=== swapping placeholders -> real imgs ==="
python3 swap-html.py
echo "=== git commit ==="
git add -A && git -c user.email="steve@designerwallcoverings.com" -c user.name="Steve" commit -q -m "Swap in real flux-schnell images (replace placeholder tiles); add image-gen reference" && git log --oneline -1
echo "=== cost ==="
gen=$(grep -c '^ok' "$log"); echo "generated ~$gen new images · flux-schnell @ \$0.003 = ~\$$(python3 -c "print(f'{$gen*0.003:.3f}')")"
echo "FINISHER_DONE"