umgefahren commited on
Commit ·
41ca88f
1
Parent(s): 9aed6d7
Don't delete directories that don't exist
Browse files
main.py
CHANGED
|
@@ -49,6 +49,10 @@ def delete_files_in_directory(directory_path: str) -> None:
|
|
| 49 |
|
| 50 |
:param directory_path: Path to the directory
|
| 51 |
"""
|
|
|
|
|
|
|
|
|
|
|
|
|
| 52 |
if not os.path.isdir(directory_path):
|
| 53 |
raise ValueError(f"The provided path '{directory_path}' is not a valid directory.")
|
| 54 |
|
|
|
|
| 49 |
|
| 50 |
:param directory_path: Path to the directory
|
| 51 |
"""
|
| 52 |
+
if not os.path.exists(directory_path):
|
| 53 |
+
print("Tiles directory doesn't exist")
|
| 54 |
+
return
|
| 55 |
+
|
| 56 |
if not os.path.isdir(directory_path):
|
| 57 |
raise ValueError(f"The provided path '{directory_path}' is not a valid directory.")
|
| 58 |
|