Skip to content

Commit bb71ee4

Browse files
committed
Print a summary of broken files in the end
1 parent 8722773 commit bb71ee4

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

robotframework_libtoc/libtoc.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ def create_toc(html_docs_dir, toc_file="keyword_docs.html", homepage_file="homep
187187
with open(toc_file_path, 'w', encoding="utf8") as f:
188188
f.write(toc(doc_files_links, current_date_time, os.path.relpath(homepage_path, os.path.abspath(html_docs_dir)), toc_template))
189189

190-
print("Finished. Output file: {}".format(os.path.abspath(toc_file_path)))
190+
print("TOC finished. Output file: {}".format(os.path.abspath(toc_file_path)))
191191

192192
def main():
193193
parser = argparse.ArgumentParser(description="Generates keyword docs using libdoc based on config files in direct subfolders of the resources dir and creates a TOC")
@@ -202,6 +202,8 @@ def main():
202202

203203
print(f"Creating docs for: {os.path.abspath(args.resources_dir)}")
204204

205+
broken_files = []
206+
205207
if os.path.isdir(args.output_dir):
206208
print(f"Output dir already exists, deleting it: {args.output_dir}")
207209
shutil.rmtree(args.output_dir)
@@ -217,13 +219,20 @@ def main():
217219
create_docs_for_dir(args.resources_dir, args.output_dir, os.path.abspath(os.path.join(args.resources_dir, args.config_file)))
218220
except LibdocException as e:
219221
print(f"---> !!! FAILED generating docs for {e.broken_file}!")
222+
broken_files.append(e.broken_file)
220223
print("Proceed with the next file...")
221224
print("")
222225

223226
if os.path.isdir(args.output_dir):
224227
create_toc(args.output_dir, args.toc_file, toc_template=args.toc_template, homepage_template=args.homepage_template)
225228
else:
226229
print("No docs were created!")
230+
231+
if broken_files:
232+
print("")
233+
print(f"---> !!! FAILED generating docs for {len(broken_files)} files (see details above):")
234+
for f in broken_files:
235+
print(f" - {f}")
227236

228237
if __name__ == "__main__":
229238
main()

0 commit comments

Comments
 (0)