From ed4d03e8f78dcfc68ea00fc706e7559a6be1b37c Mon Sep 17 00:00:00 2001 From: zmoon Date: Fri, 27 Sep 2024 21:07:07 +0000 Subject: [PATCH] Check work dir exists --- utils/python/nexus_nei2019_linker.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/utils/python/nexus_nei2019_linker.py b/utils/python/nexus_nei2019_linker.py index f3bd5c0..f1d2cde 100755 --- a/utils/python/nexus_nei2019_linker.py +++ b/utils/python/nexus_nei2019_linker.py @@ -134,6 +134,10 @@ def link_file(src_file, tgt_file): work_dir = args.work_dir.rstrip("/") version = args.nei_version + if not os.path.isdir(work_dir): + print(f"error: work dir setting {work_dir!r} does not exist or is not a directory") + raise SystemExit(2) + if args.read_hemco_time: if args.time_file_path is None: hemco_time_file = os.path.join(args.work_dir, "../HEMCO_sa_Time.rc") @@ -154,6 +158,7 @@ def link_file(src_file, tgt_file): raise SystemExit(1) print("src dir:", src_dir) + print("work dir:", work_dir) for d in dates: mo = d.month iwd = d.isoweekday()