Skip to content

Commit

Permalink
Improve plugin updater err handling
Browse files Browse the repository at this point in the history
Signed-off-by: Paolo Di Tommaso <paolo.ditommaso@gmail.com>
  • Loading branch information
pditommaso committed Apr 13, 2023
1 parent 42ae636 commit f397f01
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions modules/nf-commons/src/main/nextflow/plugin/PluginUpdater.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -113,11 +113,16 @@ class PluginUpdater extends UpdateManager {
// Check if it's a plugin meta file. The name must match the pattern `<plugin id>-X.Y.Z-meta.json`
final matcher = META_REGEX.matcher(uri.tokenize('/')[-1])
if( matcher.matches() ) {
final pluginId = matcher.group(1)
final temp = File.createTempFile('nxf-','json')
temp.deleteOnExit()
temp.text = /[{"id":"${pluginId}", "releases":[ ${new URL(uri).text} ]}]/
uri = 'file://' + temp.absolutePath
try {
final pluginId = matcher.group(1)
final temp = File.createTempFile('nxf-','json')
temp.deleteOnExit()
temp.text = /[{"id":"${pluginId}", "releases":[ ${new URL(uri).text} ]}]/
uri = 'file://' + temp.absolutePath
}
catch (FileNotFoundException e) {
throw new IllegalArgumentException("Provided repository URL does not exists or cannot be accessed: $uri")
}
}
// create the update repository instance
final fileName = uri.tokenize('/')[-1]
Expand Down

0 comments on commit f397f01

Please sign in to comment.