You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to avoid the redundancy of input arguments to a process, but I cannot seem to find a way to do so for that, rather simple use case, where I don't want a process to publish something, due to the fact that the enabled flag is not considered before checking the publishDir value.
The current way to tackle it is to plug in a conditional inside the publishDir path, like this:
process index {
input:
val inp_dir
publishDir {bam_dir.length() > 0 ? inp_dir: "A_PATH_THAT_WILL_NEVER_BE_USED"}, mode: 'copy', enabled: "${inp_dir.length() > 0}"
script:
'''
echo test > test.txt
'''
output:
path('*.*', includeInputs: false)
}
If I don't use the conditional, I am getting an error of "Path string cannot be empty" . I like this idea, as it makes it straightforward to publish or not, based on the input parameters even, and the processes would be cleaner that way.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I would like to avoid the redundancy of input arguments to a process, but I cannot seem to find a way to do so for that, rather simple use case, where I don't want a process to publish something, due to the fact that the
enabled
flag is not considered before checking thepublishDir
value.The current way to tackle it is to plug in a conditional inside the publishDir path, like this:
If I don't use the conditional, I am getting an error of "Path string cannot be empty" . I like this idea, as it makes it straightforward to publish or not, based on the input parameters even, and the processes would be cleaner that way.
Beta Was this translation helpful? Give feedback.
All reactions