Skip to content

Commit 1e3db93

Browse files
committed
jbr-debug-access-right-test
1 parent a64cf8b commit 1e3db93

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

infrahub_sdk/testing/repository.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import asyncio
44
import shutil
5+
import os
56
from dataclasses import dataclass, field
67
from enum import Enum
78
from pathlib import Path
@@ -58,11 +59,19 @@ def path(self) -> str:
5859
return str(self.src_directory / self.name)
5960

6061
def init(self) -> None:
62+
self.dst_directory.mkdir(parents=True, exist_ok=True)
63+
os.chmod(self.dst_directory, 0o777)
64+
65+
dest_path = self.dst_directory / self.name
66+
if dest_path.exists():
67+
shutil.rmtree(dest_path)
68+
6169
dest = shutil.copytree(
6270
src=self.src_directory,
63-
dst=self.dst_directory / self.name,
64-
ignore=shutil.ignore_patterns(".git"),
71+
dst=dest_path,
72+
ignore=shutil.ignore_patterns(".git", *self.directories_to_ignore),
6573
)
74+
6675
print(dest)
6776

6877
self._repo = GitRepoManager(str(Path(self.dst_directory / self.name)), branch=self.initial_branch)

0 commit comments

Comments
 (0)