I have a pipeline with two processes. I want to pass the results files of the first process used by the second process and save the output files in a separate directory for each of the files:
process one {
.
.
output:
file "split.*.json" into groups
.
.
}
process two {
.
.
publishDir params.output_path + "/exec_logs/train/${split.baseName}", mode: 'copy'
input:
set split from groups.flatten()
output:
file ".command.out"
file ".command.err"
.
.
"""
echo $split
"""
}
When I try the run the pipeline I get the following error:
No such variable: split in the publishDir ... line, but I have access to the split variable in the run section.
How can I get access to the split variable in the publishDir?
Thanks