Skip to content

Commit 507869a

Browse files
committed
Refactor update_catalog_hashes to remove only base library versions and improve error handling for missing apps
1 parent a775148 commit 507869a

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

catalog_reader/scripts/apps_hashes.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ def update_catalog_hashes(
8888

8989
# Remove all old library versions
9090
for old_lib_dir in app_lib_dir.iterdir():
91-
if old_lib_dir.is_dir():
91+
if old_lib_dir.is_dir() and old_lib_dir.name.startswith("base_"):
9292
shutil.rmtree(old_lib_dir.as_posix(), ignore_errors=True)
9393

9494
app_base_lib_dir = app_lib_dir / base_lib_name
@@ -110,7 +110,8 @@ def update_catalog_hashes(
110110
print(message)
111111

112112
if is_single_app and not app_found:
113-
print(f'[\033[91mERROR\x1B[0m]\tApp {app_name!r} not found in train {train_name!r}')
113+
verrors.add('app', f'App {app_name!r} not found in train {train_name!r}')
114+
verrors.check()
114115

115116

116117
def main():

0 commit comments

Comments
 (0)