#!/bin/bash
# Re-runs the hook length test. Needs: node + playwright (hooks-run.cjs), python3, ffmpeg/ffprobe, and a Mac for the speech step.
# 1) tool run: node hooks-run.cjs https://koldflux.com/tools/hooks > tool-output.json 2> tool-stderr.txt
# 2) python3 analyze.py tool-output.json > analysis.txt        (writes hooks-analysed.json)
# 3) on a Mac: python3 tts-make.py                              (writes wav/), then copy wav/ next to the scripts on the box with ffmpeg
# 4) python3 measure.py > tts-analysis.txt; python3 measure2.py > tts-analysis2.txt
# 5) python3 fillshare.py > fillshare.txt                       (reads hooks-templates.ts.txt: copy it to hooks.ts first)
set -e
node hooks-run.cjs https://koldflux.com/tools/hooks > tool-output.json 2> tool-stderr.txt
python3 analyze.py tool-output.json > analysis.txt
echo "now run tts-make.py on a Mac, copy wav/ here, then:"
python3 measure.py > tts-analysis.txt && python3 measure2.py > tts-analysis2.txt
cp hooks-templates.ts.txt hooks.ts && python3 fillshare.py > fillshare.txt
