script fixes, odd behaviour

This commit is contained in:
Robin Müller 2021-12-03 14:55:00 +01:00
parent c2bf09d506
commit df45f02c39
No known key found for this signature in database
GPG Key ID: 11D4952C8CCEF814
2 changed files with 14 additions and 8 deletions

View File

@ -53,4 +53,4 @@ html_theme = 'alabaster'
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']
html_static_path = []

View File

@ -8,6 +8,7 @@ import argparse
import webbrowser
import shutil
import sys
import time
from typing import List
@ -70,7 +71,8 @@ def main():
def handle_docs_type(args, build_dir_list: list):
if args.create:
shutil.rmtree(DOCS_FOLDER_NAME)
if os.path.exists(DOCS_FOLDER_NAME):
shutil.rmtree(DOCS_FOLDER_NAME)
create_docs_build_cfg()
build_directory = DOCS_FOLDER_NAME
elif len(build_dir_list) == 0:
@ -88,17 +90,21 @@ def handle_docs_type(args, build_dir_list: list):
os.system('cmake --build . -j')
if args.open:
if not os.path.isfile('docs/sphinx/index.html'):
print(
"No Sphinx documentation file detected. "
"Try to build it first with the -b argument"
)
sys.exit(1)
# try again..
os.system('cmake --build . -j')
if not os.path.isfile('docs/sphinx/index.html'):
print(
"No Sphinx documentation file detected. "
"Try to build it first with the -b argument"
)
sys.exit(1)
webbrowser.open('docs/sphinx/index.html')
def handle_tests_type(args, build_dir_list: list):
if args.create:
shutil.rmtree(UNITTEST_FOLDER_NAME)
if os.path.exists(UNITTEST_FOLDER_NAME):
shutil.rmtree(UNITTEST_FOLDER_NAME)
create_tests_build_cfg()
build_directory = UNITTEST_FOLDER_NAME
elif len(build_dir_list) == 0: