Files
max-sixty__worktrunk/docs/demos/shared/__init__.py
Maximilian Roos 340a83f6d0 fix: fail fast when ffmpeg lacks libass for demo GIF builds (#1237)
## Summary

- Add early `check_ffmpeg_libass()` at demo build startup — exits with
install
instructions when ffmpeg lacks libass (required for keystroke overlay
ASS
  subtitles)
- Add output verification in `record_vhs()` — catches silent failures
where VHS
  exits 0 but produces no GIF
- Document the Homebrew API-bottle vs tap-formula issue in demos
CLAUDE.md

Homebrew's API-sourced formula strips `libass`; the tap formula includes
it.
The fix is `HOMEBREW_NO_INSTALL_FROM_API=1 brew install
--build-from-source ffmpeg`.

## Test plan

- [x] Verified `check_ffmpeg_libass()` passes with correct ffmpeg
- [x] Verified full demo build succeeds with `--only wt-switch-picker`
- [x] Lints pass (`pre-commit run --all-files`)

> _This was written by Claude Code on behalf of @max-sixty_

Co-authored-by: Claude <noreply@anthropic.com>
2026-02-28 20:11:49 -08:00

75 lines
1.5 KiB
Python

"""Shared infrastructure for demo recording scripts."""
from .lib import (
REAL_HOME,
FIXTURES_DIR,
VALIDATION_RS,
DemoEnv,
DemoSize,
SIZE_SOCIAL,
SIZE_DOCS,
run,
git,
render_tape,
record_vhs,
build_wt,
commit_dated,
prepare_base_repo,
setup_claude_code_config,
setup_zellij_config,
setup_fish_config,
setup_mock_clis,
prepare_demo_repo,
# Demo recording infrastructure
check_dependencies,
check_ffmpeg_libass,
setup_demo_output,
record_all_themes,
# Text output recording
record_text,
build_tape_replacements,
# Snapshot recording
extract_commands_from_tape,
record_snapshot,
# External dependencies
ensure_vhs_binary,
)
from .themes import THEMES, format_theme_for_vhs
__all__ = [
"REAL_HOME",
"FIXTURES_DIR",
"VALIDATION_RS",
"DemoEnv",
"DemoSize",
"SIZE_SOCIAL",
"SIZE_DOCS",
"run",
"git",
"render_tape",
"record_vhs",
"build_wt",
"commit_dated",
"prepare_base_repo",
"setup_claude_code_config",
"setup_zellij_config",
"setup_fish_config",
"setup_mock_clis",
"prepare_demo_repo",
"THEMES",
"format_theme_for_vhs",
# Demo recording infrastructure
"check_dependencies",
"check_ffmpeg_libass",
"setup_demo_output",
"record_all_themes",
# Text output recording
"record_text",
"build_tape_replacements",
# Snapshot recording
"extract_commands_from_tape",
"record_snapshot",
# External dependencies
"ensure_vhs_binary",
]