diff --git a/.ci/generateIndex.py b/.ci/generateIndex.py index cf13f0172ab85faa2a671953da8f298d72f64aeb..c0ebeb7632e2c5c08c153812a354bed45721a90b 100644 --- a/.ci/generateIndex.py +++ b/.ci/generateIndex.py @@ -1,5 +1,6 @@ import os, re from os import path +from os.path import exists from natsort import natsorted from pathlib import Path import yaml @@ -341,8 +342,11 @@ for folder in cardDirs: # extract the title from the QMS metadata if "qms" in root: - title = save_tag(localroot, root, file[:-3] + ".yml", "title") - prepare_qms(localroot, root, file) + if exists(os.path.join(root, file[:-3] + ".yml")): + title = save_tag(localroot, root, file[:-3] + ".yml", "title") + prepare_qms(localroot, root, file) + else: + print("QMS document is not formatted properly.") # remove the previous header n = remove_header(localroot, root, file)