#!/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"