#!/bin/sh # # Simple shell script to do all the steps that need doing # # if a parameter exists, that's where the website is copied after generation if [ -n "$1" ] then DIRHTML=$(echo "$1"|sed 's/\/$//g'); #strips the trailing slash if need be else DIRHTML=""; fi # Create required binaries if [ ! -e "munge" ]; then gcc munge.cpp -o munge -lstdc++ -g fi # Create required symlink (this is temporary!) if [ ! -e "include/_manual" ]; then ln -s ../_manual/ include/_manual fi # create the required folders if need be, or empties them if [ ! -d "_site" ]; then mkdir _site else rm -rf _site/* fi if [ ! -d "_manual.munge" ]; then mkdir _manual.munge else rm -rf _manual.munge/* fi rm -rf _build/* && \ ./munge && \ ./build.rb chmod -R a+rx _site # if a target directory exists, copy the site there if [ ! -z "$DIRHTML" ] then rm -rf "$DIRHTML/*" cp -R _site/* "$DIRHTML/" fi