From 55a47b29d05e051535a15ab8ba1add6d63f72046 Mon Sep 17 00:00:00 2001 From: "Dr. Ernie Prabhakar" Date: Fri, 26 Jan 2024 17:02:32 -0800 Subject: [PATCH] Install package just before download --- CHANGELOG.md | 2 +- .../src/main/nextflow/quilt/jep/QuiltPackage.groovy | 3 --- .../main/nextflow/quilt/nio/QuiltFileSystemProvider.groovy | 6 ++++++ 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1ea4212b..c368343e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,7 +3,7 @@ ## [0.7.7] 2024-01-24 - Properly implement and test getFilename() -- Pre-install package if "&path" present +- Install package just before download - Add and pass `path-input` integration test - Add unit test for "&path=" Quilt+ URIs diff --git a/plugins/nf-quilt/src/main/nextflow/quilt/jep/QuiltPackage.groovy b/plugins/nf-quilt/src/main/nextflow/quilt/jep/QuiltPackage.groovy index ef94562b..9123c622 100644 --- a/plugins/nf-quilt/src/main/nextflow/quilt/jep/QuiltPackage.groovy +++ b/plugins/nf-quilt/src/main/nextflow/quilt/jep/QuiltPackage.groovy @@ -162,9 +162,6 @@ class QuiltPackage { void setup() { Files.createDirectories(this.folder) this.installed = false - if (this.parsed.hasPath()) { - install() - } } boolean is_force() { diff --git a/plugins/nf-quilt/src/main/nextflow/quilt/nio/QuiltFileSystemProvider.groovy b/plugins/nf-quilt/src/main/nextflow/quilt/nio/QuiltFileSystemProvider.groovy index 93464879..b7bb108d 100644 --- a/plugins/nf-quilt/src/main/nextflow/quilt/nio/QuiltFileSystemProvider.groovy +++ b/plugins/nf-quilt/src/main/nextflow/quilt/nio/QuiltFileSystemProvider.groovy @@ -47,6 +47,7 @@ import groovy.util.logging.Slf4j import nextflow.Global import nextflow.Session import nextflow.quilt.jep.QuiltParser +import nextflow.quilt.jep.QuiltPackage import nextflow.file.FileSystemTransferAware import nextflow.file.CopyOptions import nextflow.file.FileHelper @@ -112,6 +113,11 @@ class QuiltFileSystemProvider extends FileSystemProvider implements FileSystemTr // log.debug "QuiltFileSystemProvider.download: ${remoteFile} -> ${localDestination}" QuiltPath qPath = asQuiltPath(remoteFile) Path cachedFile = qPath.localPath() + QuiltPackage pkg = qPath.pkg() + if (!pkg.installed) { + pkg.install() + } + if (!Files.exists(cachedFile)) { throw new NoSuchFileException(remoteFile.toString()) }