Newer
Older
Import / web / internal.subflexion.com / history.sh
@John Ryland John Ryland on 22 Dec 2020 1009 bytes import NUC files
#!/bin/bash

echo '<div><div>'
ENDED=false
svn log "pages/$1.md" --username $2 --password $3 | while read LINE
do
    if [ "$LINE" == "------------------------------------------------------------------------" ]
    then
      echo '</div></div>'
      ENDED=true
      read LINE
      if [ "$LINE" != "" ]
      then
        REV=`echo $LINE | cut -d '|' -f 1`
        USR=`echo $LINE | cut -d '|' -f 2`
        DAT=`echo $LINE | cut -d '|' -f 3`
        LNS=`echo $LINE | cut -d '|' -f 4`
        echo '<div class="panel panel-default"><div class="panel-heading">'
        echo "<div class='panel-title col-sm-6'>Revision $REV</div><div align='right' class='col-sm-6'>$DAT</div><br>"
        echo '</div><div class="panel-body">'
        read LINE
        if [ $LINE == "" ]
        then
          read LINE
        fi
        echo "Author: $USR<br>Lines: $LNS<br>Message: $LINE"
        ENDED=false
      fi
    else
      echo "$LINE"
    fi
done
if [ "$ENDED" != "true" ]
then
    echo '</div></div>'
fi