mirrorer

:)
git clone https://git.sr.ht/~ashymad/mirrorer
Log | Files | Refs | LICENSE

commit f90e8365ba8c33a061da2f87526f5b7032542251
parent a80a5661f03d3b93f2f2162c1438a635b85c926e
Author: Szymon Mikulicz <szymon.mikulicz@posteo.net>
Date:   Sat, 13 Jun 2026 22:04:07 +0200

Add support for directory and mirrorer to the list

Diffstat:
Mmirror.sh | 17++++++++++++++---
Mmirrorlist | 1+
2 files changed, 15 insertions(+), 3 deletions(-)

diff --git a/mirror.sh b/mirror.sh @@ -4,12 +4,23 @@ set -e while read line; do srepo="$(echo "$line" | cut -d' ' -f1)" - reponame="$(echo "$srepo" | sed 's@.*/@@')" - owner="$(echo "$srepo" | sed 's@.*/\(.*\)/.*@\1@')" + + if [ -d "$srepo" ]; then + srepourl="$(git -C "$srepo" remote get-url origin)" + else + srepourl="$srepo" + fi + + reponame="$(echo "$srepourl" | sed 's@.*/@@')" + owner="$(echo "$srepourl" | sed 's@.*/\(.*\)/.*@\1@')" srepodir="$PWD/git/$reponame" wrepodir="$PWD/web/$reponame" - [ -d "$srepodir" ] || git clone --mirror "$srepo" "$srepodir" + if [ -d "$srepodir" ]; then + git -C "$repodir" remote update + else + git clone --mirror "$srepo" "$srepodir" + fi for drepo in $(echo "$line" | cut -d' ' -f2-); do git -C "$srepodir" push --mirror "$drepo" diff --git a/mirrorlist b/mirrorlist @@ -1,3 +1,4 @@ +. git@github.com:Ashymad/mirrorer https://git.sr.ht/~ashymad/mikuli.cz git@github.com:Ashymad/mikuli.cz https://git.sr.ht/~ashymad/dotfiles git@github.com:Ashymad/Dotfiles https://git.sr.ht/~ashymad/instow git@github.com:Ashymad/instowl