Commit 2ab4883
Fix leading **/ glob to match zero-or-more directories
Java's glob pattern `**/foo` requires at least one directory component
before `foo`, but users expect it to also match `foo` at the root level.
This change transforms leading `**/` patterns to `{,**/}` which means
"either nothing OR any number of directories", correctly matching:
- `foo` (zero directories)
- `bar/foo` (one directory)
- `bar/baz/foo` (multiple directories)
This fixes issues where `files("path/**/subdir/*.txt")` would fail to
find files in `path/subdir/` while finding files in `path/x/subdir/`.
Fixes #5948
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <[email protected]>
Signed-off-by: Rob Syme <[email protected]>1 parent 03da64e commit 2ab4883
File tree
2 files changed
+49
-1
lines changed- modules/nf-commons/src
- main/nextflow/file
- test/nextflow/file
2 files changed
+49
-1
lines changedLines changed: 7 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
859 | 859 | | |
860 | 860 | | |
861 | 861 | | |
862 | | - | |
| 862 | + | |
| 863 | + | |
| 864 | + | |
| 865 | + | |
| 866 | + | |
| 867 | + | |
| 868 | + | |
863 | 869 | | |
864 | 870 | | |
865 | 871 | | |
| |||
Lines changed: 42 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
624 | 624 | | |
625 | 625 | | |
626 | 626 | | |
| 627 | + | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
627 | 669 | | |
628 | 670 | | |
629 | 671 | | |
| |||
0 commit comments