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:
gsinghpal
2026-06-09 21:34:32 -04:00
parent 14cd6a666b
commit 4830613701
6 changed files with 241 additions and 0 deletions

28
sync-clone-all.sh Executable file
View 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"