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
Copy file name to clipboardexpand all lines: website/docs/core-concepts/vendor/vendor-manifest.mdx
+33-10
Original file line number
Diff line number
Diff line change
@@ -500,14 +500,37 @@ atmos vendor pull -c vpc
500
500
501
501
## Vendoring with Globs
502
502
503
-
When defining vendoring rules in Atmos, **glob patterns**determine which files and directories are included or excluded. Understanding how globs behave—especially when using greedy (`**`) versus non-greedy (`*`) patterns—is crucial for precise vendoring.
503
+
In Atmos, **glob patterns**define which files and directories are included or excluded during vendoring. These patterns go beyond simple wildcard characters like `*`—they follow specific rules that dictate how paths are matched. Understanding the difference between **greedy** (`**`) and **non-greedy** (`*`) patterns, along with other advanced glob syntax, ensures precise control over vendoring behavior.
504
504
505
-
### Understanding Greedy and Non-Greedy Globs
505
+
### Understanding Wildcards, Ranges, and Recursion
506
506
507
-
Globs use special wildcard characters:
507
+
Glob patterns in Atmos provide flexible and powerful matching, that's simpler to understand than regular expressions:
508
508
509
-
-`*` (single asterisk) matches any sequence of characters **within a single path segment**.
510
-
-`**` (double asterisk) matches across multiple path segments **recursively**.
509
+
<dl>
510
+
<dt>`*` (single asterisk)</dt>
511
+
<dd>Matches any sequence of characters <strong>within a single path segment</strong>.</dd>
512
+
<dd>Example: `vendor/*.yaml` matches `vendor/config.yaml` but <strong>not</strong> `vendor/subdir/config.yaml`.</dd>
513
+
514
+
<dt>`**` (double asterisk, also known as a "greedy glob")</dt>
515
+
<dd>Matches across <strong>multiple path segments recursively</strong>.</dd>
516
+
<dd>Example: `vendor/**/*.yaml` matches `vendor/config.yaml`, `vendor/subdir/config.yaml`, and `vendor/deep/nested/config.yaml`.</dd>
517
+
518
+
<dt>`?` (question mark)</dt>
519
+
<dd>Matches <strong>exactly one character</strong> in a path segment.</dd>
520
+
<dd>Example: `file?.txt` matches `file1.txt` and `fileA.txt` but <strong>not</strong> `file10.txt`.</dd>
521
+
522
+
<dt>`[abc]` (character class)</dt>
523
+
<dd>Matches <strong>any single character</strong> inside the brackets.</dd>
524
+
<dd>Example: `file[123].txt` matches `file1.txt`, `file2.txt`, and `file3.txt`, but <strong>not</strong> `file4.txt` or `file12.txt`.</dd>
525
+
526
+
<dt>`[a-z]` (character range)</dt>
527
+
<dd>Matches <strong>any single character</strong> within the specified range.</dd>
528
+
<dd>Example: `file[a-c].txt` matches `filea.txt`, `fileb.txt`, and `filec.txt`.</dd>
529
+
530
+
<dt>`{a,b,c}` (brace expansion)</dt>
531
+
<dd>Matches <strong>any of the comma-separated patterns</strong>.</dd>
532
+
<dd>Example: `*.{jpg,png,gif}` matches `image.jpg`, `image.png`, and `image.gif`.</dd>
533
+
</dl>
511
534
512
535
This distinction is important when excluding specific directories or files while vendoring.
513
536
@@ -522,12 +545,12 @@ excluded_paths:
522
545
- "**/demo-library/**/stargazers/**"
523
546
```
524
547
525
-
How It Works:
526
-
- The included_paths rule `**/demo-library/**` ensures all files inside `demo-library` (at any depth) are vendored.
527
-
- The excluded_paths rule `**/demo-library/**/stargazers/**` prevents any files inside `stargazers` subdirectories from being vendored.
548
+
How it works:
549
+
- The `included_paths` rule `**/demo-library/**` ensures all files inside `demo-library` (at any depth) are vendored.
550
+
- The `excluded_paths` rule `**/demo-library/**/stargazers/**` prevents any files inside `stargazers` subdirectories from being vendored.
528
551
529
552
This means:
530
-
- All files within demo-library except those inside any `stargazers` subdirectory are vendored.
553
+
- All files within `demo-library` except those inside any `stargazers` subdirectory are vendored.
531
554
- Any other files outside `stargazers` are unaffected by this exclusion.
532
555
533
556
#### Example: A Non-Recursive Pattern That Doesn't Work
@@ -540,7 +563,7 @@ excluded_paths:
540
563
```
541
564
542
565
In this case:
543
-
- `**/demo-library/*`only matches immediate children of demo-library, not nested files or subdirectories.
566
+
- `**/demo-library/*`only matches immediate children of `demo-library`, not nested files or subdirectories.
544
567
- This means `stargazers/` itself could be matched, but its contents might not be explicitly excluded.
545
568
- To correctly capture all subdirectories and files while still excluding stargazers, use `**/demo-library/**/*`.
0 commit comments