Skip to content

Add CLI flag deciding if we want to overwrite stuff in the target directory

As, e.g., shutil.copytree(src, dst) fails if dst exists, we need to find a way to adapt https://git.geomar.de/data/tools/data_repo_renderer/blob/master/data_repo_renderer/__init__.py#L643 to allow for over-writing the target util/ directory (one of the problems in #68 (closed)).

How to proceed:

  • Add unit-tests for an --overwrite flag and the desired behaviour of failing if any of the target files and / or the target util/ directory exist.
  • Add CLI flag --overwrite.
  • Before calling _unlink_files(file_list) check for this flag and fail if there's anything that would be over-written.