Skip to content

Commit

Permalink
specify pipeline directory to obtain config file when sync
Browse files Browse the repository at this point in the history
  • Loading branch information
mirpedrol committed Aug 7, 2023
1 parent 7787f4b commit 86f662b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
12 changes: 9 additions & 3 deletions nf_core/create.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def __init__(
default_branch=None,
):
self.template_params, skip_paths_keys, self.template_yaml = self.create_param_dict(
name, description, author, version, template_yaml_path, plain
name, description, author, version, template_yaml_path, plain, outdir if outdir else "."
)

skippable_paths = {
Expand Down Expand Up @@ -90,14 +90,20 @@ def __init__(
outdir = os.path.join(os.getcwd(), self.template_params["name_noslash"])
self.outdir = Path(outdir)

def create_param_dict(self, name, description, author, version, template_yaml_path, plain):
def create_param_dict(self, name, description, author, version, template_yaml_path, plain, pipeline_dir):
"""Creates a dictionary of parameters for the new pipeline.
Args:
name (str): Name for the pipeline.
description (str): Description for the pipeline.
author (str): Authors name of the pipeline.
version (str): Version flag.
template_yaml_path (str): Path to YAML file containing template parameters.
plain (bool): If true the pipeline template will be initialized plain, without customisation.
pipeline_dir (str): Path to the pipeline directory.
"""
# Try reading config file
_, config_yml = nf_core.utils.load_tools_config()
_, config_yml = nf_core.utils.load_tools_config(pipeline_dir)

# Obtain template customization info from template yaml file or `.nf-core.yml` config file
try:
Expand Down
2 changes: 1 addition & 1 deletion nf_core/sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def __init__(
self.gh_repo = gh_repo
self.pr_url = ""

self.config_yml_path, self.config_yml = nf_core.utils.load_tools_config()
self.config_yml_path, self.config_yml = nf_core.utils.load_tools_config(self.pipeline_dir)

# Throw deprecation warning if template_yaml_path is set
if template_yaml_path is not None:
Expand Down

0 comments on commit 86f662b

Please sign in to comment.