diff --git a/scripts/sync.sh b/scripts/sync.sh index 6308b94..ffcc7ae 100755 --- a/scripts/sync.sh +++ b/scripts/sync.sh @@ -1,9 +1,16 @@ #!/usr/bin/env bash # sync.sh — Copy telegram-join-approval-bot submodule into internal/, then apply patches. -# Usage: ./scripts/sync.sh +# Usage: cd scripts/ && ./sync.sh set -euo pipefail +# Ensure script is run from the scripts/ directory +if [[ "$(basename "$PWD")" != "scripts" ]]; then + echo "❌ This script must be run from the scripts/ directory." + echo " Usage: cd scripts/ && ./sync.sh" + exit 1 +fi + SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" ROOT_DIR="$(cd "$SCRIPT_DIR/.." && pwd)"