File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -189,12 +189,15 @@ def parse_version(version):
189189 return tuple ([ int (n ) for n in version .split ('.' ) ])
190190
191191def prepare_destination (destination_path ):
192- with os .scandir (destination_path ) as entries :
193- for entry in entries :
194- if entry .is_dir () and not entry .is_symlink ():
195- shutil .rmtree (entry .path )
196- else :
197- os .remove (entry .path )
192+ if os .path .exists (destination_path ):
193+ with os .scandir (destination_path ) as entries :
194+ for entry in entries :
195+ if entry .is_dir () and not entry .is_symlink ():
196+ shutil .rmtree (entry .path )
197+ else :
198+ os .remove (entry .path )
199+ else :
200+ os .makedirs (destination_path , 0o755 )
198201 project_path = os .path .join (destination_path , 'project' )
199202 os .mkdir (project_path , 0o755 )
200203 shutil .copytree ('scripts' , os .path .join (destination_path , 'scripts' ))
You can’t perform that action at this time.
0 commit comments