diff --git a/Website/generate.sh b/Website/generate.sh index eb7fe93..8a189d2 100755 --- a/Website/generate.sh +++ b/Website/generate.sh @@ -1,7 +1,7 @@ #!/bin/bash SITE_NAME="WickedDocs" - +DEST_DIR=generated CLEAN_MODE=0 if [ "$1" == "--clean" ] then @@ -17,13 +17,14 @@ PAGE_BASENAME="$3" if [ "$CLEAN_MODE" != "1" ] then + mkdir -p "$DEST_DIR" # This next command makes it possible for variable expansion to happen when applying the header - echo `eval $'cat <<\002\n'"$( $PAGE_BASENAME.html + echo `eval $'cat <<\002\n'"$( "$DEST_DIR/$PAGE_BASENAME.html" # The way this does the echo of the cat command causes the white space to be removed - cat pages/$PAGE_BASENAME.htm tmpl/footer.htm >> $PAGE_BASENAME.html + cat pages/$PAGE_BASENAME.htm tmpl/footer.htm >> "$DEST_DIR/$PAGE_BASENAME.html" # | sed -e "s/^[ \t]*//g" -e ":a;N;$!ba;s/\n//g" else - rm $PAGE_BASENAME.html + rm "$DEST_DIR/$PAGE_BASENAME.html" fi }