Compare commits

..

2 commits

2 changed files with 10 additions and 3 deletions

View file

@ -1,9 +1,16 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# sync.sh — Copy telegram-join-approval-bot submodule into internal/, then apply patches. # 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 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)" SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
ROOT_DIR="$(cd "$SCRIPT_DIR/.." && 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/ # Copy source files, excluding .git and keeping patches/ and scripts/
rsync -a --stats --exclude='.git' "$SUBMODULE_DIR/" "$ROOT_DIR/" \ 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 # Remove scripts/ from .gitignore so we can track our sync script
sed -i '/^scripts\/$/d' "$ROOT_DIR/.gitignore" sed -i '/^scripts\/$/d' "$ROOT_DIR/.gitignore"

@ -1 +1 @@
Subproject commit 4f3a0b9b06c097480e161d5351dcce50ea0692d0 Subproject commit 98e6a4a100cb350cadc0a074894bb2fb0b0c9394