Skip to content

Commit

Permalink
handle cases where the directory path contains the name of the component
Browse files Browse the repository at this point in the history
  • Loading branch information
mirpedrol committed Aug 29, 2024
1 parent 4e385ab commit aa2a417
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion nf_core/components/nfcore_component.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,12 @@ def __init__(
self.process_name = ""
self.environment_yml: Optional[Path] = Path(self.component_dir, "environment.yml")

repo_dir = self.component_dir.parts[: self.component_dir.parts.index(self.component_name.split("/")[0])][-1]
name_index = (
len(self.component_dir.parts)
- 1
- self.component_dir.parts[::-1].index(self.component_name.split("/")[0])
)
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 aa2a417

Please sign in to comment.