🐛 handle missing directory

This commit is contained in:
Ondřej Samohel 2022-10-26 13:51:03 +02:00
parent 61ff4253bd
commit 3ae02cfb2b
No known key found for this signature in database
GPG key ID: 02376E18990A97C6

View file

@ -815,6 +815,13 @@ class BootstrapRepos:
except Exception as e:
self._print(str(e), LOG_ERROR, exc_info=True)
return None
if not destination_dir.exists():
destination_dir.mkdir(parents=True)
elif not destination_dir.is_dir():
self._print(
"Destination exists but is not directory.", LOG_ERROR)
return None
try:
shutil.move(zip_file.as_posix(), destination_dir.as_posix())
except shutil.Error as e: