From 31cf8325e2e13ccc27e7778140c9cfbc4605bc46 Mon Sep 17 00:00:00 2001 From: Ernest Prabhakar Date: Tue, 3 Oct 2023 16:53:09 -0700 Subject: [PATCH] handle missing meta --- .../main/nextflow/quilt/QuiltProduct.groovy | 31 +++++++++---------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/plugins/nf-quilt/src/main/nextflow/quilt/QuiltProduct.groovy b/plugins/nf-quilt/src/main/nextflow/quilt/QuiltProduct.groovy index 66bc3a78..5bc876ab 100644 --- a/plugins/nf-quilt/src/main/nextflow/quilt/QuiltProduct.groovy +++ b/plugins/nf-quilt/src/main/nextflow/quilt/QuiltProduct.groovy @@ -66,17 +66,15 @@ ${cmd} ### Workflow -- workflow run name: ```${meta['workflow']?.get('runName')}``` -- scriptFile: ```${meta['workflow']?.get('scriptFile')}``` -- sessionId: ```${meta['workflow']?.get('sessionId')}``` -- start: ```${meta['time_start']}``` -- complete: ```${meta['time_complete']}``` +- **workflow run name**: ```${meta['workflow']?.get('runName')}``` +- **scriptFile**: ```${meta['workflow']?.get('scriptFile')}``` +- **sessionI**: ```${meta['workflow']?.get('sessionId')}``` +- **start**: ```${meta['time_start']}``` +- **complete**: ```${meta['time_complete']}``` ### Nextflow -```bash ${nextflow} -``` ### Processes @@ -245,20 +243,21 @@ ${nextflow} GStringTemplateEngine engine = new GStringTemplateEngine() String raw_readme = pkg.meta_overrides(KEY_README, DEFAULT_README) String cmd = "${meta['cmd']}".replace(' -', ' \\\n -') - String nf = meta['workflow']['nextflow'] - String nextflow = nf.replace(', ', '\\\n -')\ - .replace('nextflow.NextflowMeta(', ' \\\n -')\ - .replace(')', '') - //log.debug("readme: ${raw_readme}") - Writable template = engine.createTemplate(raw_readme).make([ + String nf = meta['workflow']?['nextflow'] + String nextflow = nf?.replace(', ', '```\n - **')\ + ?.replace('nextflow.NextflowMeta(', ' - **')\ + ?.replace(')', '```') + ?.replace(':', '**: ```') + String template = engine.createTemplate(raw_readme).make([ cmd: cmd, meta: meta, msg: msg, nextflow: nextflow, now: now(), - pkg: pkg.toString(), - ]) - return template.toString() + pkg: pkg.packageName, + ]).toString() + log.debug("readme.template: ${template}") + return template } List match(String glob) throws IOException {