You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(overlays): add file rename/delete + file glob pattern support (#391)
* Adds new non-spec overlays for manipulating loose files next to specs
* Adds file glob support to (most of) these non-spec overlays
* Adds a new afero.FS implementation that supports constraining updates to a target dir
* Adds various tests
|`file-prepend-lines`| Prepends lines to a file |`file`, `lines`| Glob pattern for files to transform |
40
+
|`file-search-replace`| Regex-based search and replace on a file |`file`, `regex`| Glob pattern for files to transform |
41
+
|`file-add`| Copies a new file from a source location; **fails if destination already exists**|`file`, `source`| Name of destination file |
42
+
|`file-remove`| Removes a file |`file`| Glob pattern for files to remove |
43
+
|`file-rename`| Renames a file within the same directory |`file`, `replacement`| Name of file to rename |
36
44
37
45
## Field Reference
38
46
@@ -45,11 +53,13 @@ can't easily be used.
45
53
| Section |`section`| The spec section to target (e.g., `%build`, `%install`, `%files`, `%description`) |`spec-prepend-lines`, `spec-append-lines`, `spec-search-replace` (optional) |
46
54
| Package |`package`| The sub-package name for multi-package specs; omit to target the main package | All spec overlays (optional) |
47
55
| Regex |`regex`| Regular expression pattern to match |`spec-search-replace`, `file-search-replace`|
48
-
| Replacement |`replacement`| Literal replacement text; omit or leave empty to delete matched text |`spec-search-replace`, `file-search-replace` (optional)|
56
+
| Replacement |`replacement`| Literal replacement text; capture group references like `$1` are **not** expanded. Omit or leave empty to delete matched text.|`spec-search-replace`, `file-search-replace`, `file-rename`|
49
57
| Lines |`lines`| Array of text lines to insert |`spec-prepend-lines`, `spec-append-lines`, `file-prepend-lines`|
50
-
| File |`file`| The name of the non-spec file to modify or add |`file-prepend-lines`, `file-search-replace`, `file-add`|
58
+
| File |`file`| The name of the non-spec file to modify or add |`file-prepend-lines`, `file-search-replace`, `file-add`, `file-remove`, `file-rename`|
51
59
| Source |`source`| Path to source file for `file-add`; relative paths are relative to the config file |`file-add`|
52
60
61
+
> **Note:** For `file-rename`, the `replacement` field is a **filename only** (not a path). The file is renamed within its current directory.
0 commit comments