advtrains_platform/version_info

35 lines
720 B
Plaintext
Raw Normal View History

2019-05-27 05:01:40 -07:00
#!/bin/bash
ls -1r *.lua *.txt | head -12 >.filelist
echo "$(date --iso=m) [$(basename "$(realpath . )")]" >.datelist
cat .filelist | while read line ; do
echo "$(date --iso=m -r ${line}) ${line}" >>.datelist
done
anytopnm .datelist >.image
WIDTH=$(head -2 .image | tail -1 | awk '{ print $1 }')
HEIGHT=$(head -2 .image | tail -1 | awk '{ print $2 }')
echo $WIDTH
echo $HEIGHT
if [ $WIDTH -gt $HEIGHT ] ; then
ppmmake white 1 $((WIDTH-HEIGHT)) >.image_temp
pnmcat -tb .image .image_temp >.image2
fi
if [ $WIDTH -lt $HEIGHT ] ; then
ppmmake white $((HEIGHT-WIDTH)) 1 >.image_temp
pnmcat -lr .image .image_temp >.image2
fi
pnmtopng .image2 >textures/advtrains_platform_version_node.png