mirror of
https://github.com/mikefarah/yq.git
synced 2026-09-06 02:03:24 +08:00
Assignment op no longer clobbers anchor (#1029)
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user