Skip to content
This repository was archived by the owner on Dec 10, 2025. It is now read-only.

Commit 873685a

Browse files
authored
Merge pull request #103 from mongodb/copier-workflow-enh
Ensure copier app respects defaults and defined branch upon merge
2 parents 53a05c2 + 13c2dc6 commit 873685a

File tree

8 files changed

+1055
-323
lines changed

8 files changed

+1055
-323
lines changed

examples-copier/QUICK-REFERENCE.md

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -83,25 +83,40 @@ workflows:
8383
8484
## Path Transformations
8585
86+
Path transformations are used with **`glob`** and **`regex`** transformation types using the `transform` parameter.
87+
8688
### Built-in Variables
8789
- `${path}` - Full source path
8890
- `${filename}` - File name only
8991
- `${dir}` - Directory path
9092
- `${ext}` - File extension
93+
- `${relative_path}` - Path relative to glob pattern prefix (glob only)
9194

92-
### Examples
95+
### Glob Transformation Examples
9396
```yaml
9497
# Keep same path
95-
path_transform: "${path}"
98+
transformations:
99+
- glob:
100+
pattern: "examples/**/*.go"
101+
transform: "${path}"
96102
97103
# Change directory
98-
path_transform: "docs/${path}"
104+
transformations:
105+
- glob:
106+
pattern: "examples/**/*.go"
107+
transform: "docs/${relative_path}"
99108
100-
# Reorganize structure
101-
path_transform: "docs/${lang}/${category}/${filename}"
109+
# Reorganize structure (using custom variables from regex)
110+
transformations:
111+
- regex:
112+
pattern: "^examples/(?P<lang>[^/]+)/(?P<category>[^/]+)/(?P<file>.+)$"
113+
transform: "docs/${lang}/${category}/${file}"
102114
103115
# Change extension
104-
path_transform: "${dir}/${filename}.md"
116+
transformations:
117+
- glob:
118+
pattern: "examples/**/*.txt"
119+
transform: "${dir}/${filename}.md"
105120
```
106121

107122
## Commit Strategies

examples-copier/configs/copier-config-examples/QUICK-START-MAIN-CONFIG.md

Lines changed: 0 additions & 301 deletions
This file was deleted.

0 commit comments

Comments
 (0)