diff options
| author | Mitja Felicijan <mitja.felicijan@gmail.com> | 2025-08-02 20:28:26 +0200 |
|---|---|---|
| committer | Mitja Felicijan <mitja.felicijan@gmail.com> | 2025-08-02 20:28:26 +0200 |
| commit | f871619d7fedbf973c249ad6e16c0fcf7e819cf8 (patch) | |
| tree | 93bcdeb6ffb45b12580a7890b0cc1d88ce977a32 /tools/fossil-projects.sh | |
| parent | e326e848dc9e065af2cb4a324e3ebcf98ad9fb33 (diff) | |
| download | mitjafelicijan.com-f871619d7fedbf973c249ad6e16c0fcf7e819cf8.tar.gz | |
Update
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 | ||
