Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow publish mode to be a closure #4027

Closed
wants to merge 2 commits into from

Conversation

dwishsan
Copy link

Add Closure as possible PublishDir.setMode() input
This is related to #4024

This have been tested and work.

Exemple:

process {
  ext {
    Output_copy = false
  }
  publishDir {
    mode = { task.ext.Output_copy ? 'copy' : 'symlink' }
  }

  withName: 'FOO' {
    ext.Output_copy = true
  }

  withName: 'BAR' {
    ext.Output_copy = false
  }
}

Only results of the FOO process will be copied.

WARNING:
I expect the closure to return a String, so it won't work if it returns null for exemple. Maybe it should handle it?

Add Closure as possible PublishDir.setMode() input

Signed-off-by: dwishsan <[email protected]>
@bentsherman bentsherman linked an issue Jun 15, 2023 that may be closed by this pull request
@bentsherman bentsherman changed the title Update PublishDir.groovy Allow publish mode to be a closure Jun 21, 2023
@pditommaso
Copy link
Member

Closing in favour of #4186.

@pditommaso pditommaso closed this Aug 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow closure type as input in PublishDir.setMode()
3 participants