Queer European MD passionate about IT
瀏覽代碼

Bash script to generate documentation

Davte 4 年之前
父節點
當前提交
af37852f58
共有 1 個文件被更改,包括 24 次插入0 次删除
  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/;