From 4e989c3d79615f0603311e5811f435f63610fb55 Mon Sep 17 00:00:00 2001 From: Benjamin Renard Date: Wed, 21 Apr 2010 11:50:55 +0200 Subject: [PATCH] Added checkDocExportsNecessity.sh script --- checkDocExportsNecessity.sh | 42 +++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100755 checkDocExportsNecessity.sh diff --git a/checkDocExportsNecessity.sh b/checkDocExportsNecessity.sh new file mode 100755 index 00000000..76db1d06 --- /dev/null +++ b/checkDocExportsNecessity.sh @@ -0,0 +1,42 @@ +#!/bin/sh + +ROOT_DIR=$( cd `dirname $0`; pwd ) +LOCAL_CFG_DIR=$ROOT_DIR/config.local + +# Import config +if [ ! -f $LOCAL_CFG_DIR/local.sh ] +then + echo "Error : You don't have create your own local.sh file in config.local directory. You could rely on the local.sh.example file to create your version." + exit 1 +fi + +source $LOCAL_CFG_DIR/local.sh + +if [ ! -n "$EXPORT_DOC_DIR" ] +then + echo "The EXPORT_DOC_DIR variable is not define. Export doc is disabled." + exit 0 +fi + +if [ ! -d "$EXPORT_DOC_DIR" ] +then + echo "Error : Export directory $EXPORT_DOC_DIR does not exist !" + exit 2 +fi + +if [ ! -n "$LAST_UPDATE_FILE" ] +then + echo "Error : The LAST_UPDATE_FILE is necessary for update detection !" + exit 3 +fi + +cd $ROOT_DIR + +CURRENT=`grep ^commit $LAST_UPDATE_FILE | cut -d ' ' -f 2` +if [ "`git diff $CURRENT -- doc`" != "" ] +then + echo "Export documentation is necessary" + echo "=================================" + echo "Current doc exports was generated from the commit $CURRENT." + echo "Changes have been made since." +fi