From 599b73a83cf1b0f648159dbb250ab880732856a4 Mon Sep 17 00:00:00 2001 From: "Alex Pooley (@zuedev)" Date: Thu, 7 May 2026 12:54:35 +0100 Subject: Remove obsolete mirror script and add gitinfo script for repository descriptions --- scripts/gitinfo.bash | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 scripts/gitinfo.bash (limited to 'scripts/gitinfo.bash') diff --git a/scripts/gitinfo.bash b/scripts/gitinfo.bash new file mode 100644 index 0000000..e4b089f --- /dev/null +++ b/scripts/gitinfo.bash @@ -0,0 +1,18 @@ +#/bin/bash + +for repository in /repositories/*; do + cd /repositories/$(basename "$repository") + gitinfo=$(git cat-file -p @:.gitinfo) + + # does gitinfo exist? expect "fatal" if not + if [[ $gitinfo == fatal* ]]; then + echo "No .gitinfo found for $(basename "$repository")" + continue + fi + + # extract description from gitinfo (json format) + description=$(echo "$gitinfo" | grep -oP '"description":\s*"\K[^"]+') + + # write description to repository description file + echo "$description" > /repositories/$(basename "$repository")/description +done \ No newline at end of file -- cgit v1.2.3