From adc3fd7b514d395e8ad1f717c37c67c61a3acbbc Mon Sep 17 00:00:00 2001 From: sgrtye Date: Sun, 22 Sep 2024 14:03:17 +0100 Subject: [PATCH] remove existing file before creating a link --- submanager/update_mitce_config.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/submanager/update_mitce_config.py b/submanager/update_mitce_config.py index 45d22f0..43245f5 100644 --- a/submanager/update_mitce_config.py +++ b/submanager/update_mitce_config.py @@ -29,6 +29,9 @@ def update_mitce_config(credentials): save_path = os.path.join( DIRECTORY_PATH, "conf", rf"{name}-{uuid[0:13]}", file_name ) + + if os.path.exists(save_path): + os.remove(save_path) os.makedirs(os.path.dirname(save_path), exist_ok=True) os.link(global_save_path, save_path)