diff --git a/modules/nextflow/src/main/groovy/nextflow/extension/PublishOp.groovy b/modules/nextflow/src/main/groovy/nextflow/extension/PublishOp.groovy index 68f4c8dc63..96779801dc 100644 --- a/modules/nextflow/src/main/groovy/nextflow/extension/PublishOp.groovy +++ b/modules/nextflow/src/main/groovy/nextflow/extension/PublishOp.groovy @@ -121,8 +121,10 @@ class PublishOp { * @param value */ protected Object normalizePaths(value) { - if( value instanceof Path ) - return List.of(normalizePath(value)) + if( value instanceof Path ) { + final target = normalizePath(value) + return List.of(targetDir.relativize(target), target) + } if( value instanceof Collection ) { return value.collect { el -> diff --git a/modules/nextflow/src/test/groovy/nextflow/script/OutputDslTest.groovy b/modules/nextflow/src/test/groovy/nextflow/script/OutputDslTest.groovy index 125e344af0..ce3705c44a 100644 --- a/modules/nextflow/src/test/groovy/nextflow/script/OutputDslTest.groovy +++ b/modules/nextflow/src/test/groovy/nextflow/script/OutputDslTest.groovy @@ -70,7 +70,7 @@ class OutputDslTest extends Specification { target.resolve('foo/file1.txt').text == 'Hello' target.resolve('barbar/file2.txt').text == 'world' target.resolve('barbar/index.csv').text == """\ - "${target}/barbar/file2.txt" + "file2.txt","${target}/barbar/file2.txt" """.stripIndent() and: 1 * session.notifyFilePublish(target.resolve('foo/file1.txt'), file1)