-
Notifications
You must be signed in to change notification settings - Fork 122
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
Merge of two files no longer works #115
Comments
Repro:
@sinewave440hz However, I see this all the way back to json v4 when
Can you show me a case (showing the specific test.json and test2.json content) where that works in an earlier version of |
Apparently not, I tried on earlier versions last night and got the same result. I haven't dug much further into it, but I had a script working earlier that combined two package.jsons successfully. This was on a much older node.js though - 4.4.7. I will try and put aside some time to take a look at this, but in the meantime, how can we do the equivalent of the merge example in your docs, but with files? Any suggestions? |
My bet is that the difference is that your files don't end with a newline. I think |
Merge error work around
|
@eddyparkinson , didn't understand your example @trentm has said right thing, your files with json must have empty line in the end |
json is not good with newlines. It is very picky when merging. But if you first do
then it fixes the newlines. tmpfile.json will have the needed newlines and can be used with json --merge |
Doing this, as in the docs:
cat test.json test2.json | json --merge
gives the error:json: error: input is not JSON: Syntax error at line 24, column 1: {
Previously it didn't, of course.
The text was updated successfully, but these errors were encountered: