diff options
Diffstat (limited to 'tools/fossil-projects.sh')
| -rw-r--r-- | tools/fossil-projects.sh | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/tools/fossil-projects.sh b/tools/fossil-projects.sh new file mode 100644 index 0000000..bb6e673 --- /dev/null +++ b/tools/fossil-projects.sh | |||
| @@ -0,0 +1,17 @@ | |||
| 1 | set -xe | ||
| 2 | |||
| 3 | OUT=../content/pages/projects.fossil.md.part | ||
| 4 | |||
| 5 | echo -e "## Fossil repositories\n" > $OUT | ||
| 6 | |||
| 7 | find ~/Projects/ -type f -name "*.fossil" -not -path "*/website/*" | while read -r file; do | ||
| 8 | cp $file ../static/projects/ | ||
| 9 | done | ||
| 10 | |||
| 11 | find ../static/projects/ -type f -name "*.fossil" | while read -r file; do | ||
| 12 | base=$(basename "$file") | ||
| 13 | size=$(stat -c %s "$file" | numfmt --to=iec) | ||
| 14 | modified_date=$(stat -c %Y "$file") | ||
| 15 | formatted_date=$(date -d @"$modified_date" +"%Y-%m-%d %H:%M:%S") | ||
| 16 | echo -e "- [$base](/projects/$base)<br><small>Size: $size, Modified: $formatted_date</small>" >> $OUT | ||
| 17 | done | ||
