diff --git a/scripts/sync.sh b/scripts/sync.sh index ffcc7ae..23090b4 100755 --- a/scripts/sync.sh +++ b/scripts/sync.sh @@ -1,16 +1,9 @@ #!/usr/bin/env bash # sync.sh — Copy telegram-join-approval-bot submodule into internal/, then apply patches. -# Usage: cd scripts/ && ./sync.sh +# Usage: ./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)" @@ -30,7 +23,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='LICENSE' + --exclude='patches' --exclude='scripts' --exclude='README.md' --exclude='Dockerfile' # 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 98e6a4a..4f3a0b9 160000 --- a/telegram-join-approval-bot +++ b/telegram-join-approval-bot @@ -1 +1 @@ -Subproject commit 98e6a4a100cb350cadc0a074894bb2fb0b0c9394 +Subproject commit 4f3a0b9b06c097480e161d5351dcce50ea0692d0