Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -126,41 +126,43 @@ class ProcessBuilder {

/// DIRECTIVES

void accelerator( Map params, value ) {
void accelerator( Map params, value ) {
if( value instanceof Number ) {
if( params.limit==null )
params.limit=value
else if( params.request==null )
params.request=value
}
else if( value != null )
else if( value != null ) {
throw new IllegalArgumentException("Not a valid `accelerator` directive value: $value [${value.getClass().getName()}]")
}
accelerator(params)
}

void accelerator( value ) {
if( value instanceof Number )
config.put('accelerator', [limit: value])
else if( value instanceof Map )
else if( value instanceof Map || value instanceof Closure )
config.put('accelerator', value)
else if( value != null )
throw new IllegalArgumentException("Not a valid `accelerator` directive value: $value [${value.getClass().getName()}]")
}

void arch( Map params, value ) {
void arch( Map params, value ) {
if( value instanceof String ) {
if( params.name==null )
params.name=value
}
else if( value != null )
else if( value != null ) {
throw new IllegalArgumentException("Not a valid `arch` directive value: $value [${value.getClass().getName()}]")
}
arch(params)
}

void arch( value ) {
if( value instanceof String )
config.put('arch', [name: value])
else if( value instanceof Map )
else if( value instanceof Map || value instanceof Closure )
config.put('arch', value)
else if( value != null )
throw new IllegalArgumentException("Not a valid `arch` directive value: $value [${value.getClass().getName()}]")
Expand All @@ -178,7 +180,7 @@ class ProcessBuilder {
* @param opts
* @param value
*/
void disk( Map opts, value ) {
void disk( Map opts, value ) {
opts.request = value
disk(opts)
}
Expand Down Expand Up @@ -327,10 +329,10 @@ class ProcessBuilder {
*
* publishDir '/some/dir', mode: 'copy'
*
* @param params
* @param path
* @param params map of publish options
* @param path String | Closure<String>
*/
void publishDir(Map params, CharSequence path) {
void publishDir(Map params, path) {
params.put('path', path)
publishDir( params )
}
Expand Down
33 changes: 33 additions & 0 deletions tests/dynamic-publishdir.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/usr/bin/env nextflow
/*
* Copyright 2013-2025, Seqera Labs
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

params.prefix = 'my'

process TEST {
publishDir { "${prefix}/reads" }, mode: 'link'

input:
val(prefix)

script:
"""
"""
}

workflow {
TEST(params.prefix)
}
Loading