Assignment op no longer clobbers anchor (#1029)

This commit is contained in:
Mike Farah
2021-12-03 09:23:24 +11:00
parent 7d89102477
commit dba41ffed7
5 changed files with 58 additions and 12 deletions
+16
View File
@@ -196,6 +196,22 @@ will output
{a: {b: bogs}}
```
## Update node value that has an anchor
Anchor will remaple
Given a sample.yml file of:
```yaml
a: &cool cat
```
then
```bash
yq eval '.a = "dog"' sample.yml
```
will output
```yaml
a: &cool dog
```
## Update empty object and array
Given a sample.yml file of:
```yaml