aboutsummaryrefslogtreecommitdiff
path: root/clone-all-cgit-repos.sh
diff options
context:
space:
mode:
authorheqnx <root@heqnx.com>2025-05-27 21:19:00 +0300
committerheqnx <root@heqnx.com>2025-05-27 21:19:00 +0300
commit7bc1627859461cddbedd9317bd729356f001b868 (patch)
tree2e5090c63f5bdf9d22405004f062ee9d95893d56 /clone-all-cgit-repos.sh
parent590afad8001ab4a4f2f1be2202da5c2dc8bcd3e2 (diff)
downloadgists-7bc1627859461cddbedd9317bd729356f001b868.tar.gz
gists-7bc1627859461cddbedd9317bd729356f001b868.zip
added cloner script
Diffstat (limited to 'clone-all-cgit-repos.sh')
-rw-r--r--clone-all-cgit-repos.sh11
1 files changed, 11 insertions, 0 deletions
diff --git a/clone-all-cgit-repos.sh b/clone-all-cgit-repos.sh
new file mode 100644
index 0000000..1fdf658
--- /dev/null
+++ b/clone-all-cgit-repos.sh
@@ -0,0 +1,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}"