Skip to content

Commit

Permalink
Fix DSL2 support in nextflow console (#3864) [ci fast]
Browse files Browse the repository at this point in the history
Signed-off-by: Ben Sherman <[email protected]>
  • Loading branch information
bentsherman authored Apr 14, 2023
1 parent 79984a8 commit 0253f8d
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions plugins/nf-console/src/main/nextflow/ui/console/Nextflow.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import groovy.transform.ThreadInterrupt
import groovy.console.ui.Console
import groovy.console.ui.OutputTransforms
import groovy.util.logging.Slf4j
import nextflow.NextflowMeta
import nextflow.Session
import nextflow.cli.CliOptions
import nextflow.cli.CmdInfo
Expand Down Expand Up @@ -72,6 +73,8 @@ class Nextflow extends Console {
Nextflow(ClassLoader loader) {
super(loader, new ScriptBinding())
this.scriptConfig = createScriptConfig()

NextflowMeta.instance.enableDsl2()
}

protected Map createScriptConfig() {
Expand Down Expand Up @@ -134,8 +137,14 @@ class Nextflow extends Console {
binding.setSession(session)
binding.setScriptPath(path)

beforeExecution = { session.start() }
afterExecution = { session.await(); session.destroy() }
beforeExecution = {
session.start()
}
afterExecution = {
session.fireDataflowNetwork()
session.await()
session.destroy()
}

launcher.call()
}
Expand Down

0 comments on commit 0253f8d

Please sign in to comment.