mybin

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

commit dd06c4dca447740a1f727eea6445de778a46d380
parent 7b70aca37f82ad96edbd6c8ee6ef7c06f307e307
Author: Antoine Amarilli <a3nm@a3nm.net>
Date:   Sun, 11 Mar 2018 16:00:44 +0100

update descriptions; change logic

Diffstat:
fetch-all-git | 34+++++++++++++++++-----------------
1 file changed, 17 insertions(+), 17 deletions(-)

diff --git a/fetch-all-git b/fetch-all-git @@ -7,22 +7,22 @@ umask 022 cd "$FOLDER" -# clone missing repositories -curl 'https://a3nm.net/git.txt' | while read repo -do - NAME=${repo%.git} - if [ ! -d $repo ] - then - git clone --bare "https://a3nm.net/git/$NAME" "$repo" - fi -done - -# update all repositories that I have -for a in * -do - cd "$a" - # https://stackoverflow.com/a/21331942 - git fetch "https://a3nm.net/git/${a%.git}" '*:*' - cd .. +# awful parsing of cgit's output... +curl 'https://a3nm.net/git/' | + awk "/table summary='repository list'/{flag=1;next}/<\/table>/{flag=0}flag" | + 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) + if [ ! -d "$REPO" ] + then + git clone --bare "https://a3nm.net/git/$NAME" "$REPO" + else + cd "$a" + # https://stackoverflow.com/a/21331942 + git fetch "https://a3nm.net/git/${a%.git}" '*:*' + cd .. + fi + echo "$DESC" > "$REPO/description" done