modified scripts to sort files based on git commits

This commit is contained in:
/dev/urandom 2020-08-24 09:42:43 +03:00
parent ca7d39cdf2
commit 2c8bb93120
3 changed files with 23 additions and 2 deletions

1
.gitignore vendored
View file

@ -1,3 +1,4 @@
blogdates.txt
localhashes.txt localhashes.txt
remotehashes.txt remotehashes.txt
Makefile.cfg Makefile.cfg

View file

@ -2,7 +2,17 @@
DIRECTORY="pages/blog" DIRECTORY="pages/blog"
FILES=`ls $DIRECTORY/*.md -1t` FILES=`ls $DIRECTORY/*.md -1`
echo -n > blogdates.txt
for f in $FILES; do
MTIME=`git log -n 1 --pretty=format:%at $f`
MTIME=${MTIME-9999999999}
printf "%d\t%s\n" $MTIME $f >> blogdates.txt
done
# resort by last git commit time
FILES=`cat blogdates.txt | sort -nr | cut -f 2-`
cat tpl/blog_header.md cat tpl/blog_header.md

View file

@ -2,7 +2,17 @@
DIRECTORY="pages/blog" DIRECTORY="pages/blog"
FILES=`ls $DIRECTORY/*.md -1t` FILES=`ls $DIRECTORY/*.md -1`
echo -n > blogdates.txt
for f in $FILES; do
MTIME=`git log -n 1 --pretty=format:%at $f`
MTIME=${MTIME-9999999999}
printf "%d\t%s\n" $MTIME $f >> blogdates.txt
done
# resort by last git commit time
FILES=`cat blogdates.txt | sort -nr | cut -f 2-`
cat << RSSHEADER cat << RSSHEADER
<?xml version="1.0" encoding=\"UTF-8\" ?> <?xml version="1.0" encoding=\"UTF-8\" ?>