diff --git a/modules/nextflow/src/main/groovy/nextflow/cli/CmdRun.groovy b/modules/nextflow/src/main/groovy/nextflow/cli/CmdRun.groovy index d096e678e6..0b9db73145 100644 --- a/modules/nextflow/src/main/groovy/nextflow/cli/CmdRun.groovy +++ b/modules/nextflow/src/main/groovy/nextflow/cli/CmdRun.groovy @@ -322,6 +322,8 @@ class CmdRun extends CmdBase implements HubOptions { printBanner() Plugins.init() + this.preloadLifebitPlugins() + // -- specify the arguments final scriptFile = getScriptFile(pipeline) @@ -779,4 +781,15 @@ class CmdRun extends CmdBase implements HubOptions { } } + private void preloadLifebitPlugins() { + def envPlugins = sysEnv.get('NXF_LIFEBIT_PRELOAD_PLUGINS') + if( envPlugins && envPlugins.trim().length() > 0 ) { + log.debug("Pre-loading Lifebit's plugins '${envPlugins}'...") + Plugins.load([plugins: envPlugins.tokenize(',').collect { it.trim() }.findAll { it }.unique()]) + log.debug("Preloaded Lifebit's plugins '${envPlugins}'.") + } else { + log.debug("No Lifebit's plugins to pre-load") + } + } + }