Require sync.sh to be run from scripts/ directory

This commit is contained in:
Astra 2026-03-10 07:33:56 +00:00
parent cf8a6a71a7
commit 5d97a5f593

View file

@ -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)"