Skip to content

Commit

Permalink
pass pkg-test
Browse files Browse the repository at this point in the history
  • Loading branch information
drernie committed Sep 11, 2023
1 parent 3770b5d commit 9259c77
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
8 changes: 7 additions & 1 deletion plugins/nf-quilt/src/main/nextflow/quilt/QuiltProduct.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,17 @@ ${meta['workflow']['stats']['processes']}
static void writeString(String text, QuiltPackage pkg, String filename) {
String dir = pkg.packageDest()
Path path = Paths.get(dir, filename.split('/') as String[])
File parent = path.getParent().toFile()
if (parent != null && !parent.exists() && !parent.mkdirs()) {
throw new IllegalStateException("Couldn't create dir: " + parent);
}

try {
Files.write(path, text.bytes)
}
catch (Exception e) {
log.error("writeString: cannot write `$text` to `$path` for `${pkg}`")
log.error("writeString[${e.getMessage()}]: fail write `$path` for `${pkg}`")
e.printStackTrace()
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@ class QuiltPackageTest extends QuiltSpecification {
String filename = 'test.txt'
Path installPath = pkg.packageDest()
Path tempFile = File.createTempFile('test', '.txt').toPath()
println("tempFile: "+tempFile);
Path installedFile = Paths.get(installPath.toString(), filename)
expect:
Files.exists(tempFile)
Expand Down

0 comments on commit 9259c77

Please sign in to comment.