From 8029c615401e2af074d1c933543b2a0250af27ce Mon Sep 17 00:00:00 2001 From: "Alex Pooley (@zuedev)" Date: Thu, 7 May 2026 23:07:43 +0100 Subject: rename to get-repo-desc --- scripts/get-repo-desc.bash | 30 ++++++++++++++++++++++++++++++ scripts/gitinfo.bash | 30 ------------------------------ 2 files changed, 30 insertions(+), 30 deletions(-) create mode 100644 scripts/get-repo-desc.bash delete mode 100644 scripts/gitinfo.bash (limited to 'scripts') diff --git a/scripts/get-repo-desc.bash b/scripts/get-repo-desc.bash new file mode 100644 index 0000000..61d388b --- /dev/null +++ b/scripts/get-repo-desc.bash @@ -0,0 +1,30 @@ +#/bin/bash + +for repository in /repositories/*; do + echo "Processing repository: $(basename "$repository")" + + cd /repositories/$(basename "$repository") + + gitinfoExists=$(git ls-tree HEAD -- .gitinfo 2>/dev/null) + + echo "gitinfoExists: $gitinfoExists" + + # does gitinfo exist? + if [ -z "$gitinfoExists" ]; then + echo "No .gitinfo found for $(basename "$repository"). Blanking description." + echo "" > /repositories/$(basename "$repository")/description + continue + fi + + gitinfoContents=$(git cat-file -p @:.gitinfo) + + echo "gitinfoContents: $gitinfoContents" + + # extract description from gitinfo (json format) + description=$(echo "$gitinfoContents" | grep -oP '"description":\s*"\K[^"]+') + + echo "Extracted description: $description" + + # write description to repository description file + echo "$description" > /repositories/$(basename "$repository")/description +done \ No newline at end of file diff --git a/scripts/gitinfo.bash b/scripts/gitinfo.bash deleted file mode 100644 index 61d388b..0000000 --- a/scripts/gitinfo.bash +++ /dev/null @@ -1,30 +0,0 @@ -#/bin/bash - -for repository in /repositories/*; do - echo "Processing repository: $(basename "$repository")" - - cd /repositories/$(basename "$repository") - - gitinfoExists=$(git ls-tree HEAD -- .gitinfo 2>/dev/null) - - echo "gitinfoExists: $gitinfoExists" - - # does gitinfo exist? - if [ -z "$gitinfoExists" ]; then - echo "No .gitinfo found for $(basename "$repository"). Blanking description." - echo "" > /repositories/$(basename "$repository")/description - continue - fi - - gitinfoContents=$(git cat-file -p @:.gitinfo) - - echo "gitinfoContents: $gitinfoContents" - - # extract description from gitinfo (json format) - description=$(echo "$gitinfoContents" | grep -oP '"description":\s*"\K[^"]+') - - echo "Extracted description: $description" - - # write description to repository description file - echo "$description" > /repositories/$(basename "$repository")/description -done \ No newline at end of file -- cgit v1.2.3