Skip to content

Commit

Permalink
fix issue where tool and subtool have the same name
Browse files Browse the repository at this point in the history
  • Loading branch information
nvnieuwk committed Sep 3, 2024
1 parent 25224a0 commit 6482287
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion nf_core/components/nfcore_component.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,19 @@ def __init__(
self.process_name = ""
self.environment_yml: Optional[Path] = Path(self.component_dir, "environment.yml")

component_list = self.component_name.split("/")

name_index = (
len(self.component_dir.parts)
- 1
- self.component_dir.parts[::-1].index(self.component_name.split("/")[0])
- self.component_dir.parts[::-1].index(component_list[0])
)
if len(component_list) != 1 and component_list[0] == component_list[1]:
# Handle cases where the subtool has the same name as the tool
name_index -= 1

repo_dir = self.component_dir.parts[:name_index][-1]

self.org = repo_dir
self.nftest_testdir = Path(self.component_dir, "tests")
self.nftest_main_nf = Path(self.nftest_testdir, "main.nf.test")
Expand Down

0 comments on commit 6482287

Please sign in to comment.