From: Ed Ward Date: Tue, 10 Jan 2017 08:45:01 +0000 (+0100) Subject: Updated the doit bash script to create folders and optionnally copy the resulting... X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=832b727c492b64548bf676164141135b9c65184a;p=ardour-manual-diverged Updated the doit bash script to create folders and optionnally copy the resulting site to another folder --- diff --git a/doit b/doit index a486005..b441d39 100755 --- a/doit +++ b/doit @@ -3,7 +3,37 @@ # 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 the required folders if need be, or empties them +if [ ! -d "_site" ]; then + mkdir _site +else + rm -rf _site/* +fi + +if [ ! -d "_manual" ]; then + mkdir _manual +else + rm -rf _manual/* +fi + rm -rf _build/* && \ ./munge && \ -./build.rb +ruby2.2 ./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 +