From df45f02c393bde14b232d1668f6004256615e68a Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 3 Dec 2021 14:55:00 +0100 Subject: [PATCH] script fixes, odd behaviour --- docs/conf.py | 2 +- scripts/helper.py | 20 +++++++++++++------- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index 44fd90c4..62b17192 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -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'] \ No newline at end of file +html_static_path = [] \ No newline at end of file diff --git a/scripts/helper.py b/scripts/helper.py index 5ceff8c4..5c5c202b 100755 --- a/scripts/helper.py +++ b/scripts/helper.py @@ -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: