Skip to content

Commit ffee26d

Browse files
committed
Refactor update_catalog_hashes to simplify single app handling and improve flow control
1 parent 9371dd2 commit ffee26d

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

catalog_reader/scripts/apps_hashes.py

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -45,21 +45,15 @@ def update_catalog_hashes(
4545
print('[\033[92mOK\x1B[0m]\tNo hashes found for library versions, skipping updating apps hashes')
4646
return
4747

48-
app_found = False
4948
is_single_app = train_name and app_name
5049
for train_dir in dev_directory.iterdir():
51-
if is_single_app and app_found:
52-
break
5350
if not train_dir.is_dir():
5451
continue
5552

5653
if is_single_app and train_dir.name != train_name:
5754
continue
5855

5956
for app_dir in train_dir.iterdir():
60-
if is_single_app and app_found:
61-
break
62-
6357
if not app_dir.is_dir():
6458
continue
6559

@@ -108,9 +102,9 @@ def update_catalog_hashes(
108102
print(message)
109103

110104
if is_single_app:
111-
app_found = True
105+
return
112106

113-
if is_single_app and not app_found:
107+
if is_single_app:
114108
verrors.add('app', f'App {app_name!r} not found in train {train_name!r}')
115109
verrors.check()
116110

0 commit comments

Comments
 (0)