nix-instantiate: pass pos in the --eval --json code path

This commit is contained in:
Shay Bergmann 2021-10-27 19:01:32 +00:00
parent 769de259f0
commit 465a167c43
No known key found for this signature in database
GPG key ID: 4D33B73FFDB9217C

View file

@ -52,7 +52,7 @@ void processExpr(EvalState & state, const Strings & attrPaths,
if (output == okXML)
printValueAsXML(state, strict, location, vRes, std::cout, context);
else if (output == okJSON)
printValueAsJSON(state, strict, vRes, noPos, std::cout, context);
printValueAsJSON(state, strict, vRes, v.determinePos(noPos), std::cout, context);
else {
if (strict) state.forceValueDeep(vRes);
std::cout << vRes << std::endl;