html=1
pdf=1
+images=1
if [[ ! -z $1 ]] ; then
html=0
pdf=0
+ images=0
while [[ ! -z $1 ]] ; do
case $1 in
- html) html=1 ;;
- pdf) pdf=1 ;;
+ html) html=1 ;;
+ pdf) pdf=1 ;;
+ images) images=1 ;;
*)
echo "Unknown parameter $1"
exit 1
dobudish=$(ls -d doc/build/dobudish* 2> /dev/null)
if [[ -z $dobudish ]] || [[ ! -d ${dobudish} ]]; then
- echo "There's no dobudish directory inside doc/build."
+ echo "There's no dobudish directory inside doc/build OR more than one file / dir starting with dobudish (hint: zip file downloaded there?)."
exit 1
fi
mkdir ${doc}/html
cp -R ${output}/html ${doc}/
fi
+
+if [[ $images = 1 ]]; then
+ # copy system images from Dobudish directory
+ image_list=$(mktemp)
+ perl -nle 'print $1 while m{ (?: \.\./ )+ ( system/ [^\"]+ ) }xg' ${doc}/html/*.html | sort | uniq > $image_list
+ if [[ -s $image_list ]]; then
+ tar -c -f - -T $image_list | tar -x -f - -C ${doc}/html
+ perl -pi -e 's{ (\.\./)+ system }{system}xg' ${doc}/html/*.html
+ fi
+
+ rm $image_list
+fi