Return first matching path or None.
(directory, patterns)
| 589 | |
| 590 | |
| 591 | def first_file_matching(directory, patterns): |
| 592 | """Return first matching path or None.""" |
| 593 | if not directory.is_dir(): |
| 594 | return None |
| 595 | for pat in patterns: |
| 596 | for p in directory.glob(pat): |
| 597 | return p |
| 598 | return None |
| 599 | |
| 600 | |
| 601 | def file_contains(path, pattern): |
no outgoing calls
no test coverage detected