You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Analysis:
When either of the reported failures happen (given option -f), they occur after source JSON file already open for write (and hence already truncated).
One of the feasible solutions: reinstate (rewrite) source JSON into the source file upon those cases. Reinstating of the source JSON is preferable solution (vs delaying opening file for write) for couple reasons:
it's much easier/logical from the code design point of view
some of the failures may occur when output JSON might be partially written and thus may result in an inconsistent output
When option
-f
is used (to update the output right into the source JSON file) and either of these failures occur:fail: template argument failed interpolation
fail: file <name> holds an invalid JSON
fail: argument walk-type (<walk>) not allowed, due to mode <mode> already set
fail: non-walk argument <arg> not allowed, due to option -<opt> given
fail: non-walk argument <arg> not allowed, due to mode <mode> already set
then the source JSON file is lost (becomes empty)
The text was updated successfully, but these errors were encountered: