Permalink
Browse files

Add generate script

  • Loading branch information...
pmuir committed May 3, 2012
1 parent d42448c commit a1729163017943ed7680aa9a0e5afb17f4e3198f
Showing with 38 additions and 0 deletions.
  1. +1 −0 .gitignore
  2. +37 −0 open18_java_ee_6/generate.sh
View
@@ -1,2 +1,3 @@
exploded-archives
+target
open18.ids
@@ -0,0 +1,37 @@
+#!/bin/bash
+
+# Require BASH 3 or newer
+
+REQUIRED_BASH_VERSION=3.0.0
+
+if [[ $BASH_VERSION < $REQUIRED_BASH_VERSION ]]; then
+ echo "You must use Bash version 3 or newer to run this script"
+ exit
+fi
+
+# Canonicalise the source dir, allow this script to be called anywhere
+
+SOURCE="${BASH_SOURCE[0]}"
+while [ -h "$SOURCE" ] ; do SOURCE="$(readlink "$SOURCE")"; done
+DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
+
+# DEFINE
+
+TARGET=$DIR/target/guide
+
+echo "** Building tutorial"
+
+echo "**** Cleaning $TARGET"
+rm -rf $TARGET
+mkdir -p $TARGET
+
+echo "**** Copying shared resources to $TARGET"
+cp -r gfx $TARGET
+
+files=`find * -iname \*.asciidoc`
+for file in $files
+do
+ output_filename=$TARGET/${file//.asciidoc/.html}
+ echo "**** Processing $file > ${output_filename}"
+ asciidoc -b xhtml11 -a pygments -o ${output_filename} $file
+done

0 comments on commit a172916

Please sign in to comment.