#!/usr/bin/env bash # larry-auth.sh — top-level wrapper for OAuth subscription auth. # Forwards to lib/oauth.sh, which contains the actual implementation. set -e SELF_DIR="$(cd "$(dirname "$0")" && pwd)" LARRY_HOME="${LARRY_HOME:-$HOME/.larry}" # Locate oauth.sh: prefer sibling-of-this-script, then $LARRY_HOME/lib OAUTH="" for c in "$SELF_DIR/lib/oauth.sh" "$LARRY_HOME/lib/oauth.sh"; do [ -x "$c" ] && { OAUTH="$c"; break; } done [ -n "$OAUTH" ] || { echo "larry-auth: cannot find lib/oauth.sh — reinstall larry-anywhere" >&2; exit 1; } exec "$OAUTH" "$@"