Skip to content

Commit

Permalink
refact: Try using name list
Browse files Browse the repository at this point in the history
  • Loading branch information
jvfe committed Nov 7, 2024
1 parent 347ebcc commit f20712c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions nf_core/components/update.py
Original file line number Diff line number Diff line change
Expand Up @@ -967,13 +967,15 @@ def manage_changes_in_linked_components(self, component, modules_to_update, subw
# If a module/subworkflow has been removed from the subworkflow
for module in modules_to_update:
module = module["name"]
if module not in included_modules:
included_modules_names = [m["name"] for m in included_modules]
if module not in included_modules_names:
log.info(f"Removing module '{module}' which is not included in '{component}' anymore.")
remove_module_object = ComponentRemove("modules", self.directory)
remove_module_object.remove(module, removed_by=component)
for subworkflow in subworkflows_to_update:
subworkflow = subworkflow["name"]
if subworkflow not in included_subworkflows:
included_subworkflow_names = [m["name"] for m in included_subworkflows]
if subworkflow not in included_subworkflow_names:
log.info(f"Removing subworkflow '{subworkflow}' which is not included in '{component}' anymore.")
remove_subworkflow_object = ComponentRemove("subworkflows", self.directory)
remove_subworkflow_object.remove(subworkflow, removed_by=component)
Expand Down

0 comments on commit f20712c

Please sign in to comment.