From 45d343d81047fa5cba1550591b5efcaa0c028ed2 Mon Sep 17 00:00:00 2001 From: Bertrand Benjamin Date: Tue, 2 Jan 2024 22:22:58 +0100 Subject: [PATCH] Feat: add raise error when src does not exists --- pdf_oralia/scripts.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pdf_oralia/scripts.py b/pdf_oralia/scripts.py index c4fb4cc..5ab76a9 100644 --- a/pdf_oralia/scripts.py +++ b/pdf_oralia/scripts.py @@ -90,6 +90,8 @@ def join(src, dest, force): if not force and Path(dest_locataire).exists(): raise ValueError(f"The file {dest_locataire} already exists") + if not Path(src).exists(): + raise ValueError(f"The source directory ({src}) does not exists.") join_excel(src, dest_charge, "*_charge.xlsx") logging.info(f"Les données charges ont été concaténées dans {dest_charge}") join_excel(src, dest_locataire, "*_locataire.xlsx")