Block overwriting when creating sample project

This commit is contained in:
Veronica Berglyd Olsen
2024-02-20 23:20:49 +01:00
parent 576c13d045
commit 10764a2041
2 changed files with 11 additions and 1 deletions
+7
View File
@@ -513,6 +513,13 @@ class ProjectBuilder:
"""Make a copy of the sample project by extracting the
sample.zip file to the new path.
"""
if path.exists():
SHARED.error(self.tr(
"The target folder already exists. "
"Please choose another folder."
))
return False
if (sample := CONFIG.assetPath("sample.zip")).is_file():
try:
shutil.unpack_archive(sample, path)