Skip to content

Commit d26262f

Browse files
docs(taskfiles): Document glob patterns for matching files in the current directory and subdirectories. (#34)
1 parent b6c8549 commit d26262f

1 file changed

Lines changed: 24 additions & 1 deletion

File tree

docs/dev-guide/contrib-guides-taskfiles.md

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,30 @@ binaries:
2121
BUILD_DIR: "{{.G_BUILD_DIR}}/bin"
2222
```
2323
24-
## Paths in commands
24+
## Paths
25+
26+
### Matching files with glob patterns
27+
28+
Use the glob patterns in the table below depending on your use case.
29+
30+
| Use case | Pattern |
31+
|----------------------------------------------------------------------------------------------------------|----------|
32+
| Match all files in the current directory. | `*` |
33+
| Match all files with the `.x` extension in the current directory. | `*.x` |
34+
| Match all files that are in a subdirectory directly below the current directory. | `*/*` |
35+
| Match all files with the `.x` extension that are in a subdirectory directly below the current directory. | `*/*.x` |
36+
| Match all files in the current directory and all levels of subdirectories. | `**/*` |
37+
| Match all files with the `.x` extension in the current directory and all levels of subdirectories. | `**/*.x` |
38+
39+
Patterns can be combined depending on your needs. E.g., `*/*/**/*.x` matches all files with the`.x`
40+
extension that are in a subdirectory two or more levels below the current directory.
41+
42+
:::{warning}
43+
Don't use the pattern `**` (instead of `**/*`) since it is equivalent to `*`. Note that this isn't
44+
the case in bash.
45+
:::
46+
47+
### Paths in commands
2548

2649
All paths used in commands should be quoted.
2750

0 commit comments

Comments
 (0)