Skip to content

Commit

Permalink
fixup! fix: Make sure to delete local temporary clones
Browse files Browse the repository at this point in the history
  • Loading branch information
pawamoy committed Sep 14, 2022
1 parent 97d9c52 commit 0679a67
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions copier/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
from .errors import CopierAnswersInterrupt, ExtensionNotFoundError, UserMessageError
from .subproject import Subproject
from .template import Template
from .tools import Style, TemporaryDirectory, printf
from .tools import Style, TemporaryDirectory, printf, handle_remove_readonly
from .types import (
AnyByStrDict,
JSONSerializable,
Expand Down Expand Up @@ -154,7 +154,11 @@ def __exit__(self, type, value, traceback):

def _cleanup(self) -> None:
if self.template.is_temp_clone:
rmtree(self.template.local_abspath)
rmtree(
self.template.local_abspath,
ignore_errors=False,
onerror=handle_remove_readonly,
)

def _answers_to_remember(self) -> Mapping:
"""Get only answers that will be remembered in the copier answers file."""
Expand Down

0 comments on commit 0679a67

Please sign in to comment.