Queer European MD passionate about IT
Browse Source

Bash script to generate documentation

Davte 4 years ago
parent
commit
af37852f58
1 changed files with 24 additions and 0 deletions
  1. 24 0
      generate_documentation.sh

+ 24 - 0
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/;