mirror of
https://github.com/mikefarah/yq.git
synced 2025-01-12 19:25:37 +00:00
v4.24.5
This commit is contained in:
parent
91ac643fbf
commit
3fe9e55f36
@ -135,7 +135,9 @@ a:
|
|||||||
b:
|
b:
|
||||||
- dog
|
- dog
|
||||||
- mouse
|
- mouse
|
||||||
a3: {b: [mouse]}
|
a3:
|
||||||
|
b:
|
||||||
|
- mouse
|
||||||
```
|
```
|
||||||
|
|
||||||
## String concatenation
|
## String concatenation
|
||||||
|
@ -199,7 +199,8 @@ yq '.a.b |= "bogs"' sample.yml
|
|||||||
```
|
```
|
||||||
will output
|
will output
|
||||||
```yaml
|
```yaml
|
||||||
{a: {b: bogs}}
|
a:
|
||||||
|
b: bogs
|
||||||
```
|
```
|
||||||
|
|
||||||
## Update node value that has an anchor
|
## Update node value that has an anchor
|
||||||
@ -229,6 +230,8 @@ yq '.a.b.[0] |= "bogs"' sample.yml
|
|||||||
```
|
```
|
||||||
will output
|
will output
|
||||||
```yaml
|
```yaml
|
||||||
{a: {b: [bogs]}}
|
a:
|
||||||
|
b:
|
||||||
|
- bogs
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -2,6 +2,12 @@
|
|||||||
|
|
||||||
`yq` can process files with `yaml` front matter (e.g. jekyll, assemble and others) - this is done via the `--front-matter/-f` flag.
|
`yq` can process files with `yaml` front matter (e.g. jekyll, assemble and others) - this is done via the `--front-matter/-f` flag.
|
||||||
|
|
||||||
|
Note that `yq` only processes the first passed in file for front-matter. If you'd like to process multiple files, you can:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
find -name "*.md" -exec yq --front-matter="process" '.updated_at = now' {} \;
|
||||||
|
```
|
||||||
|
|
||||||
## Process front matter
|
## Process front matter
|
||||||
|
|
||||||
Use `--front-matter=process` to process the front matter, that is run the expression against the `yaml` content, and output back the entire file, included the non-yaml content block. For example:
|
Use `--front-matter=process` to process the front matter, that is run the expression against the `yaml` content, and output back the entire file, included the non-yaml content block. For example:
|
||||||
|
Loading…
Reference in New Issue
Block a user