Add cross-machine sync tooling (clone/pull/push all module repos)
repos.txt + sync-*.sh let any machine (Mac or Windows/Git Bash) hydrate all 49 module repos and keep them in sync via GitHub+gitea. Pulls are fast-forward only (never clobber local work); pushes send commits only and flag uncommitted repos. See SYNC.md for the two-machine workflow. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
28
sync-clone-all.sh
Executable file
28
sync-clone-all.sh
Executable file
@@ -0,0 +1,28 @@
|
||||
#!/usr/bin/env bash
|
||||
# Clone every module repo listed in repos.txt into this folder.
|
||||
# Run once on a new machine, right after you clone the parent Odoo-Modules repo.
|
||||
# Adds both GitHub (origin) and gitea remotes. Never deletes or overwrites folders.
|
||||
#
|
||||
# Mac/Linux: bash sync-clone-all.sh
|
||||
# Windows : open "Git Bash" here, then: bash sync-clone-all.sh
|
||||
set -uo pipefail
|
||||
cd "$(dirname "$0")" || exit 1
|
||||
GH="https://github.com/gsinghpal"
|
||||
GITEA="https://git.nexasystems.ca/admin"
|
||||
[ -f repos.txt ] || { echo "repos.txt not found next to this script"; exit 1; }
|
||||
|
||||
cloned=0; skipped=0; failed=0
|
||||
while IFS= read -r f; do
|
||||
case "$f" in ''|\#*) continue ;; esac
|
||||
if [ -d "$f/.git" ]; then
|
||||
echo "skip (already here): $f"; skipped=$((skipped+1)); continue
|
||||
fi
|
||||
if git clone -q "$GH/$f.git" "$f"; then
|
||||
git -C "$f" remote add gitea "$GITEA/$f.git" 2>/dev/null || true
|
||||
echo "cloned: $f"; cloned=$((cloned+1))
|
||||
else
|
||||
echo "FAILED: $f"; failed=$((failed+1))
|
||||
fi
|
||||
done < repos.txt
|
||||
echo "----------------------------------------"
|
||||
echo "cloned=$cloned skipped=$skipped failed=$failed"
|
||||
Reference in New Issue
Block a user