mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-10 08:16:15 +02:00
JSON: add missing newlines
after `nix eval --json` and `nix-instantiate --eval --json`.
This commit is contained in:
parent
062e4fcdde
commit
4c2ff4a0f4
2 changed files with 4 additions and 2 deletions
|
@ -52,9 +52,10 @@ void processExpr(EvalState & state, const Strings & attrPaths,
|
||||||
state.autoCallFunction(autoArgs, v, vRes);
|
state.autoCallFunction(autoArgs, v, vRes);
|
||||||
if (output == okXML)
|
if (output == okXML)
|
||||||
printValueAsXML(state, strict, location, vRes, std::cout, context, noPos);
|
printValueAsXML(state, strict, location, vRes, std::cout, context, noPos);
|
||||||
else if (output == okJSON)
|
else if (output == okJSON) {
|
||||||
printValueAsJSON(state, strict, vRes, v.determinePos(noPos), std::cout, context, false);
|
printValueAsJSON(state, strict, vRes, v.determinePos(noPos), std::cout, context, false);
|
||||||
else {
|
std::cout << std::endl;
|
||||||
|
} else {
|
||||||
if (strict) state.forceValueDeep(vRes);
|
if (strict) state.forceValueDeep(vRes);
|
||||||
vRes.print(state.symbols, std::cout);
|
vRes.print(state.symbols, std::cout);
|
||||||
std::cout << std::endl;
|
std::cout << std::endl;
|
||||||
|
|
|
@ -117,6 +117,7 @@ struct CmdEval : MixJSON, InstallableCommand
|
||||||
else if (json) {
|
else if (json) {
|
||||||
JSONPlaceholder jsonOut(std::cout);
|
JSONPlaceholder jsonOut(std::cout);
|
||||||
printValueAsJSON(*state, true, *v, pos, jsonOut, context, false);
|
printValueAsJSON(*state, true, *v, pos, jsonOut, context, false);
|
||||||
|
std::cout << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
else {
|
else {
|
||||||
|
|
Loading…
Reference in a new issue