nix store make-content-addressed: Fix JSON construction

Fixes

  error: [json.exception.type_error.301] cannot create object from initializer list

in tests/fetchClosure.sh.
This commit is contained in:
Eelco Dolstra 2022-11-30 13:46:33 +01:00
parent 0596bdf3a9
commit 0b092bd87f

View file

@ -43,7 +43,7 @@ struct CmdMakeContentAddressed : virtual CopyCommand, virtual StorePathsCommand,
assert(i != remappings.end());
jsonRewrites[srcStore->printStorePath(path)] = srcStore->printStorePath(i->second);
}
std::cout << json::object({"rewrites", jsonRewrites}).dump();
std::cout << nlohmann::json{"rewrites", jsonRewrites}.dump();
} else {
for (auto & path : storePaths) {
auto i = remappings.find(path);