Files
public/projects/cuesplit/run
T
thesabear 63689c3fc0 add projects/ - standalone scripts alongside the Docker stacks
Two real, working scripts: an Ansible playbook run-menu (the same
pattern used identically across both the fleet-config and infra-
provisioning repos), and cuesplit, a frame-accurate FLAC/.cue
splitting utility. Sanitized paths only, logic untouched.

README gets a new "Scripts & Tooling" section pointing at it, placed
right after "What's Running" alongside the other repo-structure
pointer.
2026-08-25 11:29:04 +03:00

48 lines
1.1 KiB
Bash
Executable File

#!/usr/bin/env bash
# ~/Projects/cuesplit/run — task dispatcher (symlinked into ~/.local/bin)
# Usage: run split
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")" && pwd)"
CUESPLIT_PY="$SCRIPT_DIR/cuesplit.py"
cmd_split() {
# Find exactly one .cue file in the current directory
shopt -s nullglob
cues=(*.cue *.CUE)
shopt -u nullglob
if [ ${#cues[@]} -eq 0 ]; then
echo "No .cue file found in $(pwd)"
exit 1
fi
if [ ${#cues[@]} -gt 1 ]; then
echo "Multiple .cue files found, pick one:"
select cue in "${cues[@]}"; do
[ -n "$cue" ] && break
done
else
cue="${cues[0]}"
fi
echo "Using cue: $cue"
python3 "$CUESPLIT_PY" "$cue" split
echo "Opening split/ in Picard..."
picard "$(pwd)/split" >/dev/null 2>&1 &
disown
}
case "${1:-}" in
split)
cmd_split
;;
*)
echo "Usage: run <command>"
echo "Commands:"
echo " split - auto-find .cue in current dir and split the audio"
exit 1
;;
esac