-
Given a yaml spec:
some: wombat in V3, the following worked yq w -i file.yaml 'spec.config[+]' a giving spec:
some: wombat
config:
- a Subsequently we can add more elements to the array by running the same What's the corresponding command in V4? Doing yq e -i '.spec.config + "a"' file.yaml gives Error: !!null cannot be added to !!str could do yq e -i '.spec.config[0] = a' file.yaml but this requires maintaing the index, no? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 2 replies
-
I'd use the alternative operator with add:
|
Beta Was this translation helpful? Give feedback.
-
@mikefarah Just discovered that this, although worked in 4.4.0, does not work in 4.5.0, 4.6.0 .. |
Beta Was this translation helpful? Give feedback.
-
How does the formatting work on this @mikefarah?
when I later do |
Beta Was this translation helpful? Give feedback.
I'd use the alternative operator with add: