Update mkdoc.sh script to ensure we are in project root dir and to enable nullglob

This commit is contained in:
Tim Savannah 2019-05-13 11:43:20 -04:00
parent 81759d9b2b
commit 84528e67ed

View File

@ -1,9 +1,13 @@
#!/bin/bash #!/bin/bash
# Ensure we are in the project root directory
cd "$(dirname "$(realpath "${BASH_SOURCE[0]}")")"
shopt -s nullglob
ALL_MODS="$(echo func_timeout/*.py | tr ' ' '\n' | sed -e 's|/|.|g' -e 's|.py$||g' -e 's|.__init__$||g' | tr '\n' ' ')" ALL_MODS="$(echo func_timeout/*.py | tr ' ' '\n' | sed -e 's|/|.|g' -e 's|.py$||g' -e 's|.__init__$||g' | tr '\n' ' ')"
pydoc -w ${ALL_MODS} pydoc -w ${ALL_MODS}
mv *.html doc/ mv func_timeout*.html doc/
pushd doc >/dev/null 2>&1 pushd doc >/dev/null 2>&1
rm -f index.html rm -f index.html