aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2022-12-01 16:29:09 +0100
committerEelco Dolstra <edolstra@gmail.com>2022-12-01 16:29:09 +0100
commitf1e1ba9fe094a774f0fd05e537228e628d0bc8cb (patch)
tree06064b1bc11b2d3bc2ecd01d1cb0abb2df043b54 /src
parent16b03f03af2cbd2b8a682d737371c3194096d5e6 (diff)
Really fix 'nix store make-content-addressed --json'
https://hydra.nixos.org/log/mcgypcf9vj4n8vdmw7lj3l05c899v73w-nix-2.12.0pre20221201_16b03f0-x86_64-unknown-linux-musl.drv
Diffstat (limited to 'src')
-rw-r--r--src/nix/make-content-addressed.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/nix/make-content-addressed.cc b/src/nix/make-content-addressed.cc
index f236bebd6..d86b90fc7 100644
--- a/src/nix/make-content-addressed.cc
+++ b/src/nix/make-content-addressed.cc
@@ -37,13 +37,15 @@ struct CmdMakeContentAddressed : virtual CopyCommand, virtual StorePathsCommand,
StorePathSet(storePaths.begin(), storePaths.end()));
if (json) {
- nlohmann::json jsonRewrites = json::object();
+ auto jsonRewrites = json::object();
for (auto & path : storePaths) {
auto i = remappings.find(path);
assert(i != remappings.end());
jsonRewrites[srcStore->printStorePath(path)] = srcStore->printStorePath(i->second);
}
- std::cout << nlohmann::json{"rewrites", jsonRewrites}.dump();
+ auto json = json::object();
+ json["rewrites"] = jsonRewrites;
+ std::cout << json.dump();
} else {
for (auto & path : storePaths) {
auto i = remappings.find(path);