#!/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/ + gitea git.nexasystems.ca/admin/" 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"