Skip to content

Commit f46d716

Browse files
committed
Merge branch 'development'
2 parents cb97b4f + 8864402 commit f46d716

2 files changed

Lines changed: 24 additions & 10 deletions

File tree

schemas/presets_schema.yaml

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,16 @@ schema;modify_seq:
6060
sequence:
6161
- include: modify_schema
6262

63+
schema;cloud_map:
64+
type: map
65+
nullable: false
66+
mapping:
67+
preset: { type: str, nullable: false }
68+
base: { type: int, nullable: false }
69+
thickness: { type: int, nullable: false }
70+
density: { type: int, nullable: false }
71+
iprecptns: { type: int, nullable: false }
72+
6373
schema;preset_map:
6474
type: map
6575
nullable: false
@@ -111,14 +121,10 @@ schema;preset_map:
111121
type: float
112122
nullable: false
113123
clouds:
114-
type: map
124+
type: any
115125
nullable: false
116-
mapping:
117-
preset: {type: str, nullable: false}
118-
base: {type: int, nullable: false}
119-
thickness: {type: int, nullable: false}
120-
density: {type: int, nullable: false}
121-
iprecptns: {type: int, nullable: false}
126+
func: str_or_map
127+
enum: [cloud_map]
122128
enable_fog:
123129
type: bool
124130
nullable: false

update.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,9 +109,17 @@ def cleanup_local_files(to_delete_set: Iterable, extracted_folder: str):
109109
handled = False
110110
for special_dir, dir_description in special_dirs.items():
111111
if special_dir in path_obj.parents:
112-
# Delete only subdirectories inside special dirs that exist in the zip
113-
sub_path = relative_path.replace(f"{special_dir}/", "")
114-
if not os.path.isdir(os.path.join(extracted_folder, special_dir, sub_path)):
112+
# Get the name of the subdirectory (e.g., 'fh_report')
113+
sub_dir = path_obj.relative_to(special_dir).parts[0]
114+
115+
# If this subdirectory doesn't exist in the ZIP, it's user-added content.
116+
# We skip the deletion of the directory and all elements below it.
117+
if not (Path(extracted_folder) / special_dir / sub_dir).is_dir():
118+
handled = True
119+
break
120+
121+
# If it IS an official directory, we only delete the file if it's missing from the ZIP
122+
if not (Path(extracted_folder) / path_obj).exists():
115123
print(f" => Deleting {full_path} (from {dir_description})")
116124
delete_path(full_path)
117125
handled = True

0 commit comments

Comments
 (0)