diff --git a/modules/nextflow/src/main/groovy/nextflow/processor/PublishDir.groovy b/modules/nextflow/src/main/groovy/nextflow/processor/PublishDir.groovy index 3fab6f7c1f..5756f4e8f9 100644 --- a/modules/nextflow/src/main/groovy/nextflow/processor/PublishDir.groovy +++ b/modules/nextflow/src/main/groovy/nextflow/processor/PublishDir.groovy @@ -405,10 +405,9 @@ class PublishDir { */ @CompileStatic protected Path resolveFusionLink(Path file) { - while( file.name in getFusionLinks(file.parent) ) { - def pattern = ~/^\/fusion\/([^\/]+)\/(.*)/ + final pattern = ~/^\/fusion\/([^\/]+)\/(.*)/ + while( file.name in getFusionLinks(file.parent) ) file = file.text.replaceFirst(pattern) { _, scheme, path -> "${scheme}://${path}" } as Path - } return file }