diff --git a/scripts/sync.sh b/scripts/sync.sh index 23090b4..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)" @@ -23,7 +30,7 @@ rm -rf "$ROOT_DIR/config" "$ROOT_DIR/handlers" "$ROOT_DIR/pkg" "$ROOT_DIR/main.g # Copy source files, excluding .git and keeping patches/ and scripts/ rsync -a --stats --exclude='.git' "$SUBMODULE_DIR/" "$ROOT_DIR/" \ - --exclude='patches' --exclude='scripts' --exclude='README.md' --exclude='Dockerfile' + --exclude='patches' --exclude='scripts' --exclude='README.md' --exclude='Dockerfile' --exclude='LICENSE' # Remove scripts/ from .gitignore so we can track our sync script sed -i '/^scripts\/$/d' "$ROOT_DIR/.gitignore" diff --git a/telegram-join-approval-bot b/telegram-join-approval-bot index 4f3a0b9..98e6a4a 160000 --- a/telegram-join-approval-bot +++ b/telegram-join-approval-bot @@ -1 +1 @@ -Subproject commit 4f3a0b9b06c097480e161d5351dcce50ea0692d0 +Subproject commit 98e6a4a100cb350cadc0a074894bb2fb0b0c9394