Commit cefcccad authored by Fabian Nuraddin Alexander Gabel's avatar Fabian Nuraddin Alexander Gabel 💬
Browse files

add debug flag

parent 46523b0d
......@@ -10,6 +10,7 @@ OPTIONs:
-h, --help show this help text and exit
-b, --build where the procesing takes place (default: '' in-place)
-d, --debug retain all intermediate files for debugging purposes
-l, --location relative location on server root (for proxy servers, default: '')
-p, --prefix add path or filename prefix to html link (default: '')
-t, --topics where the topics files will reside
......@@ -27,7 +28,7 @@ PROJECT_PATH=""
RESEARCH_BUILD=`pwd`"/build"
RESEARCH_TOPICS=$RESEARCH_ROOT/topics
DEBUG_MODE="False"
DEBUG_MODE=false
while getopts ':hdb:l:s:t:w:p:' option; do
case "$option" in
......@@ -36,7 +37,7 @@ while getopts ':hdb:l:s:t:w:p:' option; do
;;
b | --build) RESEARCH_BUILD=$OPTARG
;;
d | --debug) DEBUG_MODE="True"
d | --debug) DEBUG_MODE=true
;;
t | --topics) RESEARCH_TOPICS=$OPTARG
;;
......@@ -77,7 +78,7 @@ do
-p "${PROJECT_LOCATION}" \
$RESEARCH_BUILD/forschung/topics/${filename%.md}.html >> $RESEARCH_BUILD/build.log 2>&1
rm -rf $RESEARCH_BUILD/forschung/topics/${filename%.md}{.md,*bkp}
if [ "$DEBUG_MODE" = false ]; then rm -rf $RESEARCH_BUILD/forschung/topics/${filename%.md}{.md,*bkp} ; fi
done
......@@ -92,7 +93,7 @@ do
sed -i -e "s;<h2\(.*\)>\(.*\)</h2.*>;<div\1>\2</div>;g" \
$RESEARCH_BUILD/home/${filename%.md}.html
rm -rf $RESEARCH_BUILD/home/$filename
if [ "$DEBUG_MODE" = false ]; then rm -rf $RESEARCH_BUILD/home/$filename ; fi
done
#translate wg file snippets
......@@ -105,14 +106,14 @@ do
sed -i -e "s;<h2\(.*\)>\(.*\)</h2.*>;<div\1>\2</div>;g" \
$RESEARCH_BUILD/forschung/$wg/${filename%.md}.html
rm -rf $RESEARCH_BUILD/forschung/$wg/$filename
if [ "$DEBUG_MODE" = false ]; then rm -rf $RESEARCH_BUILD/forschung/$wg/$filename ; fi
done
# build index files
$RESEARCH_BIN/run_pandoc.sh -b "$RESEARCH_BUILD/" \
$RESEARCH_BUILD/index.md >> $RESEARCH_BUILD/build.log 2>&1
rm -rf $RESEARCH_BUILD/index.md
if [ "$DEBUG_MODE" = false ]; then rm -rf $RESEARCH_BUILD/index.md ; fi
#
# # readme
echo "Creating Readme..."
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment