Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

modules update with patch deletes files in templates #3157

Open
FriederikeHanssen opened this issue Sep 3, 2024 · 1 comment
Open

modules update with patch deletes files in templates #3157

FriederikeHanssen opened this issue Sep 3, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@FriederikeHanssen
Copy link
Contributor

Description of the bug

I customised the multiqc module to have a templates folder.
I then applied nf-core modules patch which generates a diff file for the main.nf
If I then run nf-core modules update multiqc the templates folder is removed.

Command used and terminal output

1. Add templates folder to module
2. nf-core modules patch
3. nf-core modules update multiqc
4. "Preview diff in terminal, choose whether to update files":

INFO     'modules/nf-core/multiqc/tests/tags.yml' is unchanged                                                                                                                                                                                                                                            
INFO     'modules/nf-core/multiqc/templates/custom.ipynb' was removed                                                                                                                                                                                                                                     
INFO     'modules/nf-core/multiqc/templates/custom_multiqc.py' was removed

System information

nf-core/tools version 2.14.2.dev0

@FriederikeHanssen FriederikeHanssen added the bug Something isn't working label Sep 3, 2024
@FriederikeHanssen FriederikeHanssen changed the title modules update with patch deletes files in templates modules update with patch deletes files in templates Sep 3, 2024
@FriederikeHanssen
Copy link
Contributor Author

Adding the diff file, which contains the template files:

Changes in module 'nf-core/multiqc'
'modules/nf-core/multiqc/meta.yml' is unchanged
Changes in 'multiqc/main.nf':
--- modules/nf-core/multiqc/main.nf
+++ modules/nf-core/multiqc/main.nf
@@ -30,32 +30,6 @@
     def logo = multiqc_logo ? /--cl-config 'custom_logo: "${multiqc_logo}"'/ : ''
     def replace = replace_names ? "--replace-names ${replace_names}" : ''
     def samples = sample_names ? "--sample-names ${sample_names}" : ''
-    """
-    multiqc \\
-        --force \\
-        $args \\
-        $config \\
-        $extra_config \\
-        $logo \\
-        $replace \\
-        $samples \\
-        .
 
-    cat <<-END_VERSIONS > versions.yml
-    "${task.process}":
-        multiqc: \$( multiqc --version | sed -e "s/multiqc, version //g" )
-    END_VERSIONS
-    """
-
-    stub:
-    """
-    mkdir multiqc_data
-    touch multiqc_plots
-    touch multiqc_report.html
-
-    cat <<-END_VERSIONS > versions.yml
-    "${task.process}":
-        multiqc: \$( multiqc --version | sed -e "s/multiqc, version //g" )
-    END_VERSIONS
-    """
+    template "custom_multiqc.py"
 }

'modules/nf-core/multiqc/environment.yml' is unchanged
'modules/nf-core/multiqc/templates/custom.ipynb' was created
'modules/nf-core/multiqc/templates/custom_multiqc.py' was created
'modules/nf-core/multiqc/tests/main.nf.test' is unchanged
'modules/nf-core/multiqc/tests/main.nf.test.snap' is unchanged
'modules/nf-core/multiqc/tests/tags.yml' is unchanged
************************************************************

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: No status
Development

No branches or pull requests

1 participant