aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2021-05-03 16:14:29 +0200
committerGitHub <noreply@github.com>2021-05-03 16:14:29 +0200
commitef13c9c2236f06a6bd41a19d28a7feff3aae7dc8 (patch)
tree3659d47291a7d1fdad969b8329a7aae38d1b45b3
parent40378fbcba6595e195878f96a8e198325512fc1e (diff)
parent7dca9c24c4acdf2e2abe0f6a138b734701098cc6 (diff)
Merge pull request #4750 from NinjaTrappeur/nin-build-dry-run-json
nix build: make dry-run to print a json output if --json is enabled
-rw-r--r--src/nix/build.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/nix/build.cc b/src/nix/build.cc
index 03159b6cc..226c551fa 100644
--- a/src/nix/build.cc
+++ b/src/nix/build.cc
@@ -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());
}
};