fix(deploy): use official rclone for mount (brew rclone lacks FUSE on macOS)

Homebrew's rclone is compiled without 'mount' support on macOS. Resolve a
mount-capable binary ($HOME/bin/rclone, official rclone.org build) and fail
fast with install guidance if none is found. brew rclone still serves plain
transfers via spaces-env.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Natalie 2026-06-28 21:18:03 -04:00
parent 576496ca3e
commit 52e641c9a5

View file

@ -36,6 +36,18 @@ PREFIX="${PREFIX:-video-projects}"
source "$SCRIPT_DIR/lib/spaces-env.sh"
spaces_env_init
# Homebrew's rclone is built WITHOUT FUSE `mount` support on macOS (licensing).
# Use the official rclone binary (rclone.org) for the mount; brew's is fine for
# plain transfers. Install once: see deploy/README or the official downloads.
RCLONE_BIN="${RCLONE_BIN:-$HOME/bin/rclone}"
if ! "$RCLONE_BIN" mount --help >/dev/null 2>&1; then
echo "error: $RCLONE_BIN lacks 'mount' support." >&2
echo " Homebrew rclone cannot mount on macOS; install the official" >&2
echo " binary from https://rclone.org/downloads/ to \$HOME/bin/rclone" >&2
echo " (or set RCLONE_BIN to one that supports mount)." >&2
exit 1
fi
[ -d "$(dirname "$MOUNTPOINT")" ] || mkdir -p "$(dirname "$MOUNTPOINT")"
mkdir -p "$MOUNTPOINT" "$CACHE_DIR"
@ -50,7 +62,7 @@ echo "mounting spaces://$BUCKET/$PREFIX → $MOUNTPOINT (cache ≤ $CACHE_MAX)"
# --vfs-cache-mode full → real POSIX read/write semantics editors/ffmpeg expect;
# --vfs-cache-max-size → LRU eviction ceiling (keeps plum off 100%);
# --dir-cache-time → keep the directory tree warm so Finder doesn't stall.
exec rclone mount ":s3:$BUCKET/$PREFIX" "$MOUNTPOINT" \
exec "$RCLONE_BIN" mount ":s3:$BUCKET/$PREFIX" "$MOUNTPOINT" \
--vfs-cache-mode full \
--vfs-cache-max-size "$CACHE_MAX" \
--vfs-cache-max-age 720h \