#!/usr/bin/env bash set -euo pipefail FUZZ_DIR=$(cd -- "$(dirname -- "$0")" && pwd) ROOT=$(cd -- "$FUZZ_DIR/../../.." && pwd) SUBS="${EC_FIXTURES:-$ROOT/fixtures}/subs" [ -f "$SUBS/TOS-en.srt" ] || { echo "seed.sh: $SUBS/TOS-en.srt missing; run scripts/fixtures.sh" >&2; exit 2; } CORPUS="$FUZZ_DIR/corpus" mkdir -p "$CORPUS"/{srt,webvtt,markup,ir} python3 -I - "$SUBS/TOS-en.srt" "$CORPUS" <<'PY' import os, sys srt, corpus = sys.argv[1], sys.argv[2] data = open(srt, "rb").read() vtt = b"WEBVTT\n\n" + data.replace(b",", b".") for target in ("srt", "markup", "ir"): open(os.path.join(corpus, target, "real.srt"), "wb").write(data[:65536]) for target in ("webvtt", "markup", "ir"): open(os.path.join(corpus, target, "real.vtt"), "wb").write(vtt[:65536]) print("ec-subs seeds written") PY