Kapitan's utils.copy_tree() calls shutil.copytree() which will create the destination directory if it doesn't exist yet. However, currently, utils.copy_tree() doesn't support this case and will raise a SafeCopyError when the destination directory doesn't exist.
This PR adjusts the implementation to only raise a SafeCopyError when the destination exists and isn't a directory and will let shutil.copytree() create the destination if the destination doesn't exist at all.
Proposed Changes
Kapitan's
utils.copy_tree()
callsshutil.copytree()
which will create the destination directory if it doesn't exist yet. However, currently,utils.copy_tree()
doesn't support this case and will raise aSafeCopyError
when the destination directory doesn't exist.This PR adjusts the implementation to only raise a
SafeCopyError
when the destination exists and isn't a directory and will letshutil.copytree()
create the destination if the destination doesn't exist at all.Docs and Tests