mirror of
https://github.com/NixOS/nix
synced 2025-07-07 14:21:48 +02:00
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
This commit is contained in:
parent
16b03f03af
commit
f1e1ba9fe0
2 changed files with 16 additions and 11 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue