#!/bin/sh # # DIRECTIFY: Create the Image Directory for a Game. if [ -f .header ] then cat .header >index.html fi # Get rid of garbage. find . -type f -size -5 -print -maxdepth 1 | grep jpg | xargs rm -f # Make a list of subdirectories, adding icons if there is one. echo "" >>index.html for each in [A-Z]* do if [ -d "$each" ] then echo "
" >>index.html echo "$each" >>index.html echo "
(`ls $each/* | grep -v index.html | wc -l` Images)
" >>index.html fi done echo "

" >>index.html # Now, go in and make thumbnails. This kills the processor. if [ ! -f .descs ] then touch .descs fi for father in * do if [ ! "$father" = "index.html" ] then if [ ! -d "$father" ] then if [ ! -f ".thumbs/$father" ] then echo "Thumbnailing $directory/$father...." cp "$father" ".thumbs/$father" mogrify -geometry 100 ".thumbs/$father" fi DESC="`grep $father .descs | cut -f2- -d' '`" echo "\"$DESC\"" >>index.html # Ahh! Recursion! If the directory has images, go in there too. else if [ -d "$father/.thumbs" ] then echo "[%] Found a $father sub-directory. Making a page." cd $father /webdocs/computist/directify cd .. fi fi fi done if [ -f .footer ] then cat .footer >>index.html fi