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:
23
sync-refresh-list.sh
Executable file
23
sync-refresh-list.sh
Executable file
@@ -0,0 +1,23 @@
|
||||
#!/usr/bin/env bash
|
||||
# Regenerate repos.txt from the actual module folders present here (any top-level
|
||||
# folder that is its own git repo with a github.com/gsinghpal origin). Run this
|
||||
# after you add or remove a module repo, then commit repos.txt so both machines
|
||||
# pick up the change.
|
||||
#
|
||||
# bash sync-refresh-list.sh
|
||||
set -uo pipefail
|
||||
cd "$(dirname "$0")" || exit 1
|
||||
|
||||
{
|
||||
echo "# Module repos that live as independent git repos inside this folder."
|
||||
echo "# Owner: github.com/gsinghpal/<name> + gitea git.nexasystems.ca/admin/<name>"
|
||||
echo "# One repo name per line. Used by sync-*.sh. Regenerate with: bash sync-refresh-list.sh"
|
||||
for d in */; do
|
||||
d="${d%/}"
|
||||
[ -d "$d/.git" ] || continue
|
||||
url=$(git -C "$d" remote get-url origin 2>/dev/null || true)
|
||||
case "$url" in *github.com/gsinghpal/*) echo "$d" ;; esac
|
||||
done
|
||||
} > repos.txt.tmp && mv repos.txt.tmp repos.txt
|
||||
|
||||
echo "repos.txt now lists $(grep -cvE '^\s*#|^\s*$' repos.txt) repos"
|
||||
Reference in New Issue
Block a user