1
0
mirror of https://github.com/taigrr/yq synced 2025-01-18 04:53:17 -08:00

Fixed create yaml

This commit is contained in:
Mike Farah
2020-12-01 14:06:49 +11:00
parent c9229439f7
commit 08f579f4e3
6 changed files with 60 additions and 5 deletions

View File

@@ -5,6 +5,18 @@ Which will assign the LHS node values to the RHS node values. The RHS expression
### relative form: `|=`
This will do a similar thing to the plain form, however, the RHS expression is run against _the LHS nodes_. This is useful for updating values based on old values, e.g. increment.
## Create yaml file
Running
```bash
yq eval --null-input '(.a.b = "cat") | (.x = "frog")'
```
will output
```yaml
a:
b: cat
x: frog
```
## Update node to be the child value
Given a sample.yml file of:
```yaml