#!/bin/sh
# dirlist -- just does a dir listing in gph format
DIR=${1:-$PWD}
for f in "$DIR"/*; do
   bn=$(basename "$f")
   mtime="Updated: $(git log --pretty="%as" -- "$f" | head -n 1)"
   if [ "$bn" != "index.gph" ] && [ "$bn" != "index.tmpl" ]; then
       if [ -d "$f" ]; then
           printf "[1|%-30s$mtime|$bn|server|port]\n" "$bn"
       else
           printf "[0|%-30s$mtime|$bn|server|port]\n" "$bn"
       fi
   fi
done

printf "\n[1|<-- Home|/|server|port]\n"