Proto-to-Prod

This commit is contained in:
Pen Anderson 2026-05-26 11:52:32 -05:00
parent 82a8a6a21a
commit 5cabc31d37
63 changed files with 3783 additions and 602 deletions

39
bin/pull-audio Executable file
View file

@ -0,0 +1,39 @@
#!/usr/bin/env bash
# Copy concert WAV files from the curator's Dropbox folder into content/audio/,
# stripping the ` Brianna` suffix that the source files carry.
# Idempotent: skips files that already exist at the destination.
set -euo pipefail
SRC_DIR="${SRC_DIR:-$HOME/Dropbox/File requests/Mill Run Audio}"
DEST_DIR="${DEST_DIR:-$(cd "$(dirname "$0")/.." && pwd)/content/audio}"
if [[ ! -d "$SRC_DIR" ]]; then
echo "error: source directory not found: $SRC_DIR" >&2
exit 1
fi
mkdir -p "$DEST_DIR"
count=0
copied=0
skipped=0
shopt -s nullglob
for src in "$SRC_DIR"/*.wav; do
count=$((count + 1))
name=$(basename "$src")
# Strip trailing " Brianna.wav" → ".wav"
dest_name="${name% Brianna.wav}.wav"
dest="$DEST_DIR/$dest_name"
if [[ -f "$dest" ]] && [[ $(stat -c %s "$src") -eq $(stat -c %s "$dest") ]]; then
skipped=$((skipped + 1))
continue
fi
printf ' [%2d] %s\n' "$count" "$dest_name"
cp -- "$src" "$dest"
copied=$((copied + 1))
done
printf '\n%d total · %d copied · %d skipped (already present)\n' "$count" "$copied" "$skipped"