nix build: make dry-run to print a json output if --json is enabled

This commit is contained in:
Félix Baylac-Jacqué 2021-04-27 10:44:29 +02:00
parent fe2bf464cf
commit 7dca9c24c4
No known key found for this signature in database
GPG key ID: EFD315F31848DBA4

View file

@ -54,6 +54,8 @@ struct CmdBuild : InstallablesCommand, MixDryRun, MixJSON, MixProfile
{
auto buildables = build(store, dryRun ? Realise::Nothing : Realise::Outputs, installables, buildMode);
if (json) logger->cout("%s", derivedPathsWithHintsToJSON(buildables, store).dump());
if (dryRun) return;
if (outLink != "")
@ -79,8 +81,6 @@ struct CmdBuild : InstallablesCommand, MixDryRun, MixJSON, MixProfile
}
updateProfile(buildables);
if (json) logger->cout("%s", derivedPathsWithHintsToJSON(buildables, store).dump());
}
};