fix error if destination arg is not provided

This commit is contained in:
Jan Grewe 2023-10-22 12:36:16 +02:00
parent 7be5570d21
commit 263eb013e4

View File

@ -52,7 +52,8 @@ class Template():
f.writelines(lines) f.writelines(lines)
def copy_files(self, destination, project_name): def copy_files(self, destination, project_name):
dest = pathlib.Path(destination) project_name = project_name.replace(" ", "_")
dest = pathlib.Path(destination).joinpath(project_name)
if dest.exists() and dest.is_dir(): if dest.exists() and dest.is_dir():
if len(list(dest.glob("*.*"))) > 0: if len(list(dest.glob("*.*"))) > 0:
raise ValueError(f"Destination folder ({str(dest.absolute())}) already exists and is not empty") raise ValueError(f"Destination folder ({str(dest.absolute())}) already exists and is not empty")