add sync script
This commit is contained in:
parent
8aa8521304
commit
7eddff3ae5
1 changed files with 4 additions and 4 deletions
|
|
@ -1,5 +1,5 @@
|
|||
#!/usr/bin/env bash
|
||||
# sync.sh — Copy telegram-approval-join submodule into internal/, then apply branding patches.
|
||||
# sync.sh — Copy telegram-approval-join submodule into internal/, then apply patches.
|
||||
# Usage: ./scripts/sync.sh
|
||||
|
||||
set -euo pipefail
|
||||
|
|
@ -50,9 +50,9 @@ sed -i "s|^module git\.zio\.sh/astra/telegram-approval-join|module git.zio.sh/as
|
|||
echo "→ Rewriting import paths in .go files ..."
|
||||
find "$ROOT_DIR" -name '*.go' -not -path "*/telegram-approval-join/*" | xargs sed -i 's|git\.zio\.sh/astra/telegram-approval-join|git.zio.sh/astra/telegram-approval-join-nuzzles|g'
|
||||
|
||||
# ── 4. Apply branding string patch ────────────────────────────────────────────
|
||||
# ── 4. Apply string patch ────────────────────────────────────────────
|
||||
if [[ -f "$PATCH_FILE" ]]; then
|
||||
echo "→ Applying branding patch ..."
|
||||
echo "→ Applying patch ..."
|
||||
# Check if patch applies cleanly first (dry run)
|
||||
if patch --dry-run -p1 -d "$ROOT_DIR" < "$PATCH_FILE" &>/dev/null; then
|
||||
patch -p1 --no-backup-if-mismatch -d "$ROOT_DIR" < "$PATCH_FILE"
|
||||
|
|
@ -77,7 +77,7 @@ go build ./... 2>&1 && echo " Build OK." || { echo "❌ Build failed."; exit 1
|
|||
# ── 6. Commit changes ─────────────────────────────────────────────────────────
|
||||
echo "→ Committing changes..."
|
||||
git -C "$ROOT_DIR" add -A
|
||||
git -C "$ROOT_DIR" commit -m "Update telegram-approval-join submodule and apply branding patches" || true
|
||||
git -C "$ROOT_DIR" commit -m "Update telegram-approval-join submodule and apply patches" || true
|
||||
|
||||
echo ""
|
||||
echo "✅ Sync complete. Root directory is up to date with telegram-approval-join (patched)."
|
||||
Loading…
Add table
Add a link
Reference in a new issue