From 6b9772e59de3a15fe6d1fbc95be0e1b512bd5b0e Mon Sep 17 00:00:00 2001 From: cpauvert Date: Fri, 5 Jul 2024 16:27:45 +0200 Subject: [PATCH 1/2] ensure conda execution is enabled in configuration when using --use-conda (fixes #4) --- .../{{cookiecutter.project_slug}}/util.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/util.py b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/util.py index ff8cc93..ac85f11 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/util.py +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/util.py @@ -138,6 +138,9 @@ def run_nextflow( # Use conda if use_conda: + append_config_block( + scope="conda", enabled='"true"' + ) if conda_frontend == "mamba": append_config_block( scope="conda", useMamba='"true"', cacheDir=f'"{conda_prefix}"' From ace94bff5716272fef0e8d6568c9333063301cc6 Mon Sep 17 00:00:00 2001 From: cpauvert Date: Fri, 5 Jul 2024 17:04:27 +0200 Subject: [PATCH 2/2] add tab to beautify the generated nextflow configuration --- .../{{cookiecutter.project_slug}}/util.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/util.py b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/util.py index ac85f11..1726487 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/util.py +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/util.py @@ -46,7 +46,7 @@ def append_config_block(nf_config="nextflow.config", scope=None, **kwargs): with open(nf_config, "a") as f: f.write(scope.rstrip() + "{" + "\n") for k in kwargs: - f.write(f"{k} = {kwargs[k]}\n") + f.write(f"\t{k} = {kwargs[k]}\n") f.write("}\n")