Merge pull request #7372 from edolstra/fix-json

nix store make-content-addressed: Fix JSON construction
This commit is contained in:
Eelco Dolstra 2022-11-30 14:25:15 +01:00 committed by GitHub
commit f91dc023f2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

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