From 7dca9c24c4acdf2e2abe0f6a138b734701098cc6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Baylac-Jacqu=C3=A9?= Date: Tue, 27 Apr 2021 10:44:29 +0200 Subject: [PATCH] nix build: make dry-run to print a json output if --json is enabled --- src/nix/build.cc | 4 ++-- 1 file 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()); } };