]> Shamusworld >> Repos - ardour-manual-diverged/blobdiff - doit
Transition commit as per discussion with rgareus.
[ardour-manual-diverged] / doit
diff --git a/doit b/doit
new file mode 100755 (executable)
index 0000000..8b8b787
--- /dev/null
+++ b/doit
@@ -0,0 +1,43 @@
+#!/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 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
+