From 8a2320d34515e3a37209f4b4a43752acfa2fe611 Mon Sep 17 00:00:00 2001 From: Florian De Temmerman Date: Mon, 16 Oct 2023 16:23:40 +0200 Subject: [PATCH] fix remote outdir in NfCoreTemplate.groovy See: https://github.com/nf-core/tools/pull/2465 --- lib/NfcoreTemplate.groovy | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/lib/NfcoreTemplate.groovy b/lib/NfcoreTemplate.groovy index 0498726a..66ad49d4 100755 --- a/lib/NfcoreTemplate.groovy +++ b/lib/NfcoreTemplate.groovy @@ -156,14 +156,16 @@ class NfcoreTemplate { } // Write summary e-mail HTML to a file - def output_d = new File("${params.outdir}/pipeline_info/") - if (!output_d.exists()) { - output_d.mkdirs() - } - def output_hf = new File(output_d, "pipeline_report.html") + def output_hf = new File(workflow.launchDir.toString(), ".pipeline_report.html") output_hf.withWriter { w -> w << email_html } - def output_tf = new File(output_d, "pipeline_report.txt") + FilesEx.copyTo(output_hf.toPath(), "${params.outdir}/pipeline_info/pipeline_report.html"); + output_hf.delete() + + // Write summary e-mail TXT to a file + def output_tf = new File(workflow.launchDir.toString(), ".pipeline_report.txt") output_tf.withWriter { w -> w << email_txt } + FilesEx.copyTo(output_tf.toPath(), "${params.outdir}/pipeline_info/pipeline_report.txt"); + output_tf.delete() } // @@ -234,8 +236,7 @@ class NfcoreTemplate { def jsonStr = JsonOutput.toJson(params) temp_pf.text = JsonOutput.prettyPrint(jsonStr) - def destination = "${params.outdir}/pipeline_info/params_${timestamp}.json" - FilesEx.copyTo(temp_pf.toPath(), destination) + FilesEx.copyTo(temp_pf.toPath(), "${params.outdir}/pipeline_info/params_${timestamp}.json") temp_pf.delete() }