Skip to content
This repository was archived by the owner on Aug 20, 2024. It is now read-only.

Commit 055eb80

Browse files
committed
update docs and add check if any files are found
1 parent 1cd18b2 commit 055eb80

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

docs/nextflow_schema/nextflow_schema_specification.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -342,13 +342,16 @@ Example usage is as follows:
342342
The available `format` types are below:
343343

344344
`file-path`
345-
: States if the provided value is a file. Does not check its existence, but it does check that the path is not a directory.
345+
: States that the provided value is a file. Does not check its existence, but it does check that the path is not a directory.
346346

347347
`directory-path`
348-
: States if the provided value is a directory. Does not check its existence, but if it exists, it does check that the path is not a file.
348+
: States that the provided value is a directory. Does not check its existence, but if it exists, it does check that the path is not a file.
349349

350350
`path`
351-
: States if the provided value is a path (file or directory). Does not check its existence.
351+
: States that the provided value is a path (file or directory). Does not check its existence.
352+
353+
`file-path-pattern`
354+
: States that the provided value is a globbing pattern that will be used to fetch files. Checks that the pattern is valid and that at least one file is found.
352355

353356
### `exists`
354357

plugins/nf-validation/src/main/nextflow/validation/FormatValidators/FilePathPatternValidator.groovy

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,13 @@ public class FilePathPatternValidator implements FormatValidator {
1717
}
1818
ArrayList files = Nextflow.file(subject) as ArrayList
1919
ArrayList errors = []
20+
println("${subject}: ${files.size()}")
21+
if(files.size() == 0) {
22+
return Optional.of("No files were found using the globbing pattern '${subject}'" as String)
23+
}
2024
for( file : files ) {
2125
if (file.isDirectory()) {
22-
errors.add("'${subject}' is not a file, but a directory" as String)
26+
errors.add("'${file.toString()}' is not a file, but a directory" as String)
2327
}
2428
}
2529
if(errors.size > 0) {

0 commit comments

Comments
 (0)