New feature
Allow introspecting the workflow.output.* parameters within the workflow itself
Use case
This would allow mainly allow printing info messages to the user and conditionally checking validity of output paths and modes, e.g.:
if (workflow.output.enabled) {
if (file(workflow.outputDir).exists()) {
if (params.clobber) {
log.warn "Overwriting existing output"
} else {
error "${workflow.outputDir} already exists, use clobber = true to overwrite"
}
}
log.info "${workflow.output.mode}ing output files to ${workflow.outputDir}"
} else {
log.info "Leaving output in nextflow workDir ${workflow.workDir}"
}
Suggested implementation
Add the config options for workflow.output to the workflow metadata object accessible within the workflow itself, as sketched out above.