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 -i
does not work on empty files with comments
#869
Comments
Yeah that's a known issue - though I hadn't considered empty yaml docs with comments. That is annoying. |
Unfortunately there's not much I can do in |
yq -i
does not work on empty filesyq -i
does not work on empty files with comments
as a workaround, you could put in an empty object # interesting comment
{} |
OK understood... I don't think that's a huge issue of course, but just to be clear my issue is not about the comments, but rather that
The (minor) problem I have with starting with an
|
Good call, I've added it to 'Known Issues' - I'm going to have another look when I get more time and see if I can fix it so it just works. |
I've made some changes in |
Working fine for me! |
Describe the bug
yq -i
seems to return an empty file when there are no values in the original file, even losing any original comments.Version of yq: 4.9.6
Operating system: mac
Installed via: homebrew
Input Yaml
test.yaml:
# comment
Command
The command you ran:
Actual behavior
File is empty
Expected behavior
Additional context
It works when an empty object is specified in JSON format:
The text was updated successfully, but these errors were encountered: