mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-10 08:16:15 +02:00
nix-env: don't output incomplete JSON
This commit is contained in:
parent
8188b1d0ab
commit
7535ee345d
1 changed files with 2 additions and 2 deletions
|
@ -940,12 +940,12 @@ static void queryJSON(Globals & globals, std::vector<DrvInfo> & elems, bool prin
|
||||||
JSONObject metaObj = pkgObj.object("meta");
|
JSONObject metaObj = pkgObj.object("meta");
|
||||||
StringSet metaNames = i.queryMetaNames();
|
StringSet metaNames = i.queryMetaNames();
|
||||||
for (auto & j : metaNames) {
|
for (auto & j : metaNames) {
|
||||||
auto placeholder = metaObj.placeholder(j);
|
|
||||||
Value * v = i.queryMeta(j);
|
Value * v = i.queryMeta(j);
|
||||||
if (!v) {
|
if (!v) {
|
||||||
printError("derivation '%s' has invalid meta attribute '%s'", i.queryName(), j);
|
printError("derivation '%s' has invalid meta attribute '%s'", i.queryName(), j);
|
||||||
placeholder.write(nullptr);
|
metaObj.attr(j, nullptr);
|
||||||
} else {
|
} else {
|
||||||
|
auto placeholder = metaObj.placeholder(j);
|
||||||
PathSet context;
|
PathSet context;
|
||||||
printValueAsJSON(*globals.state, true, *v, noPos, placeholder, context);
|
printValueAsJSON(*globals.state, true, *v, noPos, placeholder, context);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue