Skip to content

Commit

Permalink
remove existing file before creating a link
Browse files Browse the repository at this point in the history
  • Loading branch information
sgrtye committed Sep 22, 2024
1 parent 5d5dd39 commit adc3fd7
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions submanager/update_mitce_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit adc3fd7

Please sign in to comment.