mybin

my ~/bin
git clone https://a3nm.net/git/mybin/
Log | Files | Refs | README

commit ec8496933a93176b96e04823e2b60dc9e30c80bc
parent b8c93358a7f0d1504524b19309e0c17d07e2cd9e
Author: Antoine Amarilli <a3nm@a3nm.net>
Date:   Wed,  4 May 2022 21:48:09 +0200

fix parsing of cgit output

Diffstat:
fetch-all-git | 8+++++---
1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/fetch-all-git b/fetch-all-git @@ -8,12 +8,14 @@ umask 022 cd "$FOLDER" # awful parsing of cgit's output... -curl 'https://a3nm.net/git/' | - awk "/table summary='repository list'/{flag=1;next}/<\/table>/{flag=0}flag" | +curl -s 'https://a3nm.net/git/' | + grep '<tr>' | + sed '1,3d' | + sed 's/.*<tr>/<tr>/g' | while read l; do NAME=$(echo "$l" | cut -d'>' -f4 | cut -d'<' -f1) REPO="$NAME.git" - DESC=$(echo "$l" | cut -d'>' -f8 | cut -d'<' -f1) + DESC=$(echo "$l" | cut -d'>' -f7-) if [ ! -d "$REPO" ] then git clone --bare "https://a3nm.net/git/$NAME" "$REPO"