From 7596ed49be941e5e3d3ae65c9c54e8b05f962892 Mon Sep 17 00:00:00 2001 From: xenofem Date: Mon, 22 Jan 2024 07:43:24 -0500 Subject: [PATCH] refuse to manual-collate a nonexistent path --- dlibrary.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/dlibrary.py b/dlibrary.py index 8626cb3..cccf5e1 100755 --- a/dlibrary.py +++ b/dlibrary.py @@ -208,6 +208,12 @@ def manual_collate(args): if collation_dir.exists() and len(list(collation_dir.iterdir())) > 0: print(f'Collation directory already exists!') return + + nonexistent = [path for path in args.paths if not path.exists()] + if len(nonexistent) > 0: + print(f'Nonexistent paths: {nonexistent}') + return + collation_dir.mkdir(parents=True, exist_ok=True) index = 0