-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathc64cast.sh
More file actions
executable file
·26 lines (24 loc) · 1.07 KB
/
Copy pathc64cast.sh
File metadata and controls
executable file
·26 lines (24 loc) · 1.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/usr/bin/env bash
# Launch c64cast, forwarding all args. Two modes, picked by what you pass:
# - config-driven: scripts/c64cast.sh --config c64cast.toml
# - quick playback: scripts/c64cast.sh clip.mp4 tune.sid assets/pictures/
# (positional MEDIA args build an in-memory playlist; one scene each,
# played once. Point at hardware with -u, e.g. -u u64://192.168.2.64
# or -u tr://. Needs the `yt` extra for non-direct URLs.)
#
# Runs via uv when present so the project .venv is always used (matches the
# mise + direnv + uv workflow); falls back to a bare `python` otherwise.
set -euo pipefail
# Redirect cd's stdout: if the caller's shell has CDPATH set, a relative cd
# echoes the resolved directory, which would otherwise leak into our output.
cd "$(dirname "$0")/.." > /dev/null
# With no args, argparse falls through to the built-in default config and
# tries (and fails) to connect to it. Show --help instead.
if [ "$#" -eq 0 ]; then
set -- --help
fi
if command -v uv >/dev/null 2>&1; then
exec uv run python -m c64cast "$@"
else
exec python -m c64cast "$@"
fi