blob: b2b4057e153c2c3d42db60e46beb5aa1e7d000c4 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
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
|