diff --git a/modules/nf-commons/src/main/nextflow/plugin/PluginUpdater.groovy b/modules/nf-commons/src/main/nextflow/plugin/PluginUpdater.groovy index 2de6229cfe..df4f1a4348 100644 --- a/modules/nf-commons/src/main/nextflow/plugin/PluginUpdater.groovy +++ b/modules/nf-commons/src/main/nextflow/plugin/PluginUpdater.groovy @@ -58,7 +58,7 @@ import org.pf4j.util.FileUtils @CompileStatic class PluginUpdater extends UpdateManager { - static final Pattern META_REGEX = ~/(.+)-(\d+\.\d+\.\d+)-meta\.json/ + static final public Pattern META_REGEX = ~/(.+)-(\d+\.\d+\.\d+\S*)-meta\.json/ private CustomPluginManager pluginManager diff --git a/modules/nf-commons/src/test/nextflow/plugin/PluginUpdaterTest.groovy b/modules/nf-commons/src/test/nextflow/plugin/PluginUpdaterTest.groovy index 7a64f55dc7..8e8420d422 100644 --- a/modules/nf-commons/src/test/nextflow/plugin/PluginUpdaterTest.groovy +++ b/modules/nf-commons/src/test/nextflow/plugin/PluginUpdaterTest.groovy @@ -385,4 +385,21 @@ class PluginUpdaterTest extends Specification { 'nf-amazon' | '1.1.0' | '1.0.0' | true } + + @Unroll + def 'should match meta file name' () { + when: + def matcher = PluginUpdater.META_REGEX.matcher(FILE_NAME) + then: + matcher.matches() == EXPECTED + !EXPECTED || matcher.group(1) == PLUGIN + + where: + FILE_NAME | EXPECTED | PLUGIN + 'foo' | false | null + 'foo.json' | false | null + 'nf-foo-1.0.0-meta.json' | true | 'nf-foo' + 'xpack-google-1.0.0-beta.3-meta.json' | true | 'xpack-google' + + } }