mirror of
https://github.com/NixOS/nix.git
synced 2025-11-11 13:06:01 +01:00
nix-instantiate --eval --json: Devirtualize the output
This commit is contained in:
parent
7bafc99f20
commit
df7a2a1bed
1 changed files with 3 additions and 2 deletions
|
|
@ -17,6 +17,7 @@
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
|
#include <nlohmann/json.hpp>
|
||||||
|
|
||||||
using namespace nix;
|
using namespace nix;
|
||||||
|
|
||||||
|
|
@ -61,8 +62,8 @@ void processExpr(EvalState & state, const Strings & attrPaths,
|
||||||
else if (output == okXML)
|
else 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);
|
auto j = printValueAsJSON(state, strict, vRes, v.determinePos(noPos), context);
|
||||||
std::cout << std::endl;
|
std::cout << state.devirtualize(j.dump(), context) << std::endl;
|
||||||
} else {
|
} else {
|
||||||
if (strict) state.forceValueDeep(vRes);
|
if (strict) state.forceValueDeep(vRes);
|
||||||
std::set<const void *> seen;
|
std::set<const void *> seen;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue