file:find
Options
| Name | Type | Description |
|---|---|---|
path | string | File or directory to search; directories are scanned recursively |
ext | []string | File extensions to restrict the search (e.g. ["go", "md"]) |
pattern | string | Regex pattern to match within file contents |
matches | map[string]string | Maps capture group index (as string) to an output key name |
Example
name: Find post files and capture their slug
actions:
- name: posts
component: file:find
vars:
path: ./content
ext: md
pattern: '^post-(.*)\.md$'
matches:
"1": slug