From af37852f58508e07943f049ad622f86d4fed37bc Mon Sep 17 00:00:00 2001 From: Davte Date: Fri, 19 Jul 2019 12:03:33 +0200 Subject: [PATCH] Bash script to generate documentation --- generate_documentation.sh | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 generate_documentation.sh diff --git a/generate_documentation.sh b/generate_documentation.sh new file mode 100644 index 0000000..9f632c4 --- /dev/null +++ b/generate_documentation.sh @@ -0,0 +1,24 @@ +#!/bin/bash + +# Get current directory +this_script_directory=$(cd `dirname $0` && pwd) + +# Import variables from my_config.sh +# `$python_virtual_environment`: python virtual environment directory for packaging +# containing `python` and `pip` +source "$this_script_directory/my_config.sh"; + +# Ensure the success of importing procedure +if [ -z "${python_virtual_environment}" ]; +then + printf "Please set in ""my_config.sh"" the path to bot python virtual environment\n\nExample:\npython_virtual_environment=""path/to/virtual/env""\n"; + exit; +fi + +"$python_virtual_environment/python" -m pdoc --html --force --output "$this_script_directory/temp" "$this_script_directory/ciclopibot"; + +rm -rf documentation/; + +mv "$this_script_directory/temp/ciclopibot/" "$this_script_directory/documentation/"; + +rm -rf temp/;