Add terminal walkthrough assets
This commit is contained in:
parent
be654b5b41
commit
895cb608c0
6 changed files with 153 additions and 0 deletions
25
scripts/render_tape.sh
Executable file
25
scripts/render_tape.sh
Executable file
|
|
@ -0,0 +1,25 @@
|
|||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
if [ "$#" -lt 1 ] || [ "$#" -gt 2 ]; then
|
||||
printf 'Usage: %s <tape-file> [output-file]\n' "$0" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! command -v vhs >/dev/null 2>&1; then
|
||||
printf '%s\n' 'vhs is required to render terminal recordings.' >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
||||
TAPE_FILE="$1"
|
||||
OUTPUT_FILE="${2:-}"
|
||||
|
||||
cd "$ROOT_DIR"
|
||||
vhs validate "$TAPE_FILE"
|
||||
|
||||
if [ -n "$OUTPUT_FILE" ]; then
|
||||
vhs -o "$OUTPUT_FILE" "$TAPE_FILE"
|
||||
else
|
||||
vhs "$TAPE_FILE"
|
||||
fi
|
||||
Loading…
Add table
Add a link
Reference in a new issue