Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

yq e removes '---' header #1462

Closed
KauzClay opened this issue Dec 6, 2022 · 2 comments
Closed

yq e removes '---' header #1462

KauzClay opened this issue Dec 6, 2022 · 2 comments
Labels

Comments

@KauzClay
Copy link

KauzClay commented Dec 6, 2022

Describe the bug
When I use yq, it removes the --- marker of my yaml document

Version of yq: 4.30.5
Operating system: mac
Installed via: homebrew

Input Yaml

example.yaml:

#! some ytt comments 
#@ a = b

---
kind: First
value: 1
---
kind: Second
value: 1

Command

❯ yq e  ' select(documentIndex == 0 ) ' example.yaml

Actual behavior

#! some ytt comments
#@ a = b
kind: First
value: 1

Expected behavior

#! some ytt comments
#@ a = b

---
kind: First
value: 1

Additional context
Sorry to bring this back up again, I'd gone through #351 and #1056 before reporting.

Strangely, if I don't have that empty line before the --- and input document looks like this:

#! some ytt comments 
#@ a = b
---
kind: First
value: 1
---
kind: Second
value: 1

Then it behaves how I'd expect:

❯ yq e  ' select(documentIndex == 0 ) ' /tmp/example.yaml
#! some ytt comments
#@ a = b
---
kind: First
value: 1
@mikefarah
Copy link
Owner

Found the bug, will fix in the next release

@mikefarah
Copy link
Owner

Fixed in v4.30.6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants