Skip to content

Commit

Permalink
add error handling for if script does not exist
Browse files Browse the repository at this point in the history
  • Loading branch information
Blargian committed Jan 23, 2025
1 parent 56e76b2 commit 3dabda3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion scripts/table-of-contents-generator/toc_gen.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,9 @@ def main():
if root_dir is None:
print("Please provide a directory with argument --dir")
sys.exit(1)

if os.path.lexists(root_dir) is False:
print("Path provided does not exist")
sys.exit(1)
if args.single_toc:
json_items = [] # single list for all directories

Expand Down

0 comments on commit 3dabda3

Please sign in to comment.