diff options
| author | Alex Pooley (@zuedev) <zuedev@gmail.com> | 2026-05-07 23:07:43 +0100 |
|---|---|---|
| committer | Alex Pooley (@zuedev) <zuedev@gmail.com> | 2026-05-07 23:07:43 +0100 |
| commit | 8029c615401e2af074d1c933543b2a0250af27ce (patch) | |
| tree | 935a45219e6217e4a77256b05b2a569a23a661f4 /scripts/get-repo-desc.bash | |
| parent | ae9b87278868502d057527d3619fe7e9d967e41a (diff) | |
| download | git.zue.dev-8029c615401e2af074d1c933543b2a0250af27ce.tar git.zue.dev-8029c615401e2af074d1c933543b2a0250af27ce.tar.gz git.zue.dev-8029c615401e2af074d1c933543b2a0250af27ce.tar.bz2 git.zue.dev-8029c615401e2af074d1c933543b2a0250af27ce.tar.xz git.zue.dev-8029c615401e2af074d1c933543b2a0250af27ce.zip | |
rename to get-repo-desc
Diffstat (limited to 'scripts/get-repo-desc.bash')
| -rw-r--r-- | scripts/get-repo-desc.bash | 30 |
1 files changed, 30 insertions, 0 deletions
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 |
