Skip to content

Commit

Permalink
Revert "refact: Use modulesrepo for current_repo in install"
Browse files Browse the repository at this point in the history
This reverts commit f4cc0fe.
  • Loading branch information
jvfe committed Dec 16, 2024
1 parent c0a7a00 commit c5bebcf
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions nf_core/components/install.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def __init__(
installed_by: Optional[List[str]] = None,
):
super().__init__(component_type, pipeline_dir, remote_url, branch, no_pull)
self.current_remote = ModulesRepo(remote_url, branch)
self.current_remote = remote_url
self.branch = branch
self.force = force
self.prompt = prompt
Expand All @@ -50,15 +50,15 @@ def __init__(
def install(self, component: Union[str, Dict[str, str]], silent: bool = False) -> bool:
if isinstance(component, dict):
# Override modules_repo when the component to install is a dependency from a subworkflow.
remote_url = component.get("git_remote", self.current_remote.remote_url)
remote_url = component.get("git_remote", self.current_remote)
branch = component.get("branch", self.branch)
self.modules_repo = ModulesRepo(remote_url, branch)
component = component["name"]

if self.current_remote is None:
self.current_remote = self.modules_repo
self.current_remote = self.modules_repo.remote_url

if self.current_remote.remote_url == self.modules_repo.remote_url and self.sha is not None:
if self.current_remote == self.modules_repo.remote_url and self.sha is not None:
self.current_sha = self.sha
else:
self.current_sha = None
Expand Down Expand Up @@ -241,7 +241,7 @@ def collect_and_verify_name(

raise ValueError

if self.current_remote.remote_url == modules_repo.remote_url:
if self.current_remote == modules_repo.remote_url:
if not modules_repo.component_exists(component, self.component_type, commit=self.current_sha):
warn_msg = f"{self.component_type[:-1].title()} '{component}' not found in remote '{modules_repo.remote_url}' ({modules_repo.branch})"
log.warning(warn_msg)
Expand Down

0 comments on commit c5bebcf

Please sign in to comment.