Update telegram-join-approval-bot submodule and apply patches
This commit is contained in:
parent
f1efc1d937
commit
80d8018905
8 changed files with 11 additions and 17 deletions
2
go.mod
2
go.mod
|
|
@ -1,4 +1,4 @@
|
||||||
module git.zio.sh/astra/telegram-join-approval-nuzzles
|
module git.zio.sh/astra/telegram-approval-join
|
||||||
|
|
||||||
go 1.25.3
|
go 1.25.3
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ import (
|
||||||
"log"
|
"log"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
utils "git.zio.sh/astra/telegram-join-approval-nuzzles/pkg/utils"
|
utils "git.zio.sh/astra/telegram-approval-join/pkg/utils"
|
||||||
api "github.com/OvyFlash/telegram-bot-api"
|
api "github.com/OvyFlash/telegram-bot-api"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ import (
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
utils "git.zio.sh/astra/telegram-join-approval-nuzzles/pkg/utils"
|
utils "git.zio.sh/astra/telegram-approval-join/pkg/utils"
|
||||||
api "github.com/OvyFlash/telegram-bot-api"
|
api "github.com/OvyFlash/telegram-bot-api"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ package handlers
|
||||||
import (
|
import (
|
||||||
"sync"
|
"sync"
|
||||||
|
|
||||||
config "git.zio.sh/astra/telegram-join-approval-nuzzles/config"
|
config "git.zio.sh/astra/telegram-approval-join/config"
|
||||||
api "github.com/OvyFlash/telegram-bot-api"
|
api "github.com/OvyFlash/telegram-bot-api"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"log"
|
"log"
|
||||||
|
|
||||||
utils "git.zio.sh/astra/telegram-join-approval-nuzzles/pkg/utils"
|
utils "git.zio.sh/astra/telegram-approval-join/pkg/utils"
|
||||||
api "github.com/OvyFlash/telegram-bot-api"
|
api "github.com/OvyFlash/telegram-bot-api"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
||||||
4
main.go
4
main.go
|
|
@ -3,8 +3,8 @@ package main
|
||||||
import (
|
import (
|
||||||
"log"
|
"log"
|
||||||
|
|
||||||
"git.zio.sh/astra/telegram-join-approval-nuzzles/config"
|
"git.zio.sh/astra/telegram-approval-join/config"
|
||||||
"git.zio.sh/astra/telegram-join-approval-nuzzles/handlers"
|
"git.zio.sh/astra/telegram-approval-join/handlers"
|
||||||
api "github.com/OvyFlash/telegram-bot-api"
|
api "github.com/OvyFlash/telegram-bot-api"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
||||||
1
scripts/.gitignore
vendored
Normal file
1
scripts/.gitignore
vendored
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
config.yaml
|
||||||
|
|
@ -13,23 +13,16 @@ PATCH_FILE="$ROOT_DIR/patches/0001-nuzzles.patch"
|
||||||
# ── 1. Ensure submodule is initialised ────────────────────────────────────────
|
# ── 1. Ensure submodule is initialised ────────────────────────────────────────
|
||||||
echo "→ Updating submodule..."
|
echo "→ Updating submodule..."
|
||||||
|
|
||||||
# Capture the submodule commit before update
|
|
||||||
OLD_COMMIT=$(git -C "$SUBMODULE_DIR" rev-parse HEAD 2>/dev/null || echo "")
|
|
||||||
|
|
||||||
# Update the submodule
|
# Update the submodule
|
||||||
git -C "$ROOT_DIR" submodule update --init --recursive --remote
|
git -C "$ROOT_DIR" submodule update --init --recursive --remote
|
||||||
|
|
||||||
# Capture the submodule commit after update
|
|
||||||
NEW_COMMIT=$(git -C "$SUBMODULE_DIR" rev-parse HEAD 2>/dev/null || echo "")
|
|
||||||
|
|
||||||
# ── 2. Wipe and re-copy the submodule source ──────────────────────────────────
|
# ── 2. Wipe and re-copy the submodule source ──────────────────────────────────
|
||||||
echo "→ Copying telegram-join-approval-bot source to root..."
|
echo "→ Copying telegram-join-approval-bot source to root..."
|
||||||
# Clean up directories that will be replaced
|
# Clean up directories that will be replaced
|
||||||
rm -rf "$ROOT_DIR/cmd" "$ROOT_DIR/internal" "$ROOT_DIR/go.mod" "$ROOT_DIR/go.sum" "$ROOT_DIR/config.yaml.example"
|
rm -rf "$ROOT_DIR/config" "$ROOT_DIR/handlers" "$ROOT_DIR/pkg" "$ROOT_DIR/main.go" "$ROOT_DIR/go.mod" "$ROOT_DIR/go.sum"
|
||||||
|
|
||||||
# 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' --exclude='internal/telegram-join-approval-bot' \
|
rsync -a --stats --exclude='.git' "$SUBMODULE_DIR/" "$ROOT_DIR/" \
|
||||||
"$SUBMODULE_DIR/" "$ROOT_DIR/" \
|
|
||||||
--exclude='patches' --exclude='scripts' --exclude='README.md' --exclude='Dockerfile'
|
--exclude='patches' --exclude='scripts' --exclude='README.md' --exclude='Dockerfile'
|
||||||
|
|
||||||
# Remove scripts/ from .gitignore so we can track our sync script
|
# Remove scripts/ from .gitignore so we can track our sync script
|
||||||
|
|
@ -42,7 +35,7 @@ sed -i "s|^module git\.zio\.sh/astra/telegram-join-approval-bot|module git.zio.s
|
||||||
|
|
||||||
# Fix all import references in the copied source
|
# Fix all import references in the copied source
|
||||||
echo "→ Rewriting import paths in .go files ..."
|
echo "→ Rewriting import paths in .go files ..."
|
||||||
find "$ROOT_DIR" -name '*.go' -not -path "*/telegram-join-approval-bot/*" | xargs sed -i 's|git\.zio\.sh/astra/telegram-join-approval-bot|git.zio.sh/astra/telegram-join-approval-nuzzles|g'
|
find "$ROOT_DIR" -name '*.go' -not -path "*/telegram-join-approval-bot/telegram-join-approval-bot/*" | xargs sed -i 's|git\.zio\.sh/astra/telegram-join-approval-bot|git.zio.sh/astra/telegram-join-approval-nuzzles|g'
|
||||||
|
|
||||||
# ── 4. Apply string patch ────────────────────────────────────────────
|
# ── 4. Apply string patch ────────────────────────────────────────────
|
||||||
if [[ -f "$PATCH_FILE" ]]; then
|
if [[ -f "$PATCH_FILE" ]]; then
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue