File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change 22
33import asyncio
44import shutil
5+ import os
56from dataclasses import dataclass , field
67from enum import Enum
78from 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 )
You can’t perform that action at this time.
0 commit comments