aboutsummaryrefslogtreecommitdiff
path: root/clone-all-cgit-repos.sh
blob: 1fdf658f32259e08e35fdc2069068ecf4261681b (plain)
1
2
3
4
5
6
7
8
9
10
11
#!/bin/bash

cgit="https://cgit.heqnx.com"

repos=$(curl -sSL "${cgit}" | grep -o "<a href='/[^']*/'>" | sed -E "s/^<a href='([^']*)'>/\1/" | sort -u)

mkdir repos &>/dev/null
while IFS= read -r i; do
    printf "%s\n" "[inf] ${cgit}${i}"
    git -C repos clone "${cgit}${i}"
done <<< "${repos}"