diff options
author | Eelco Dolstra <edolstra@gmail.com> | 2022-08-16 14:58:08 +0200 |
---|---|---|
committer | Eelco Dolstra <edolstra@gmail.com> | 2022-08-17 11:31:34 +0200 |
commit | e62160579f40a0425061c2223e0a303d42736ea2 (patch) | |
tree | 506c45db53abb9bbf175c5a941c5cdb698da25b8 | |
parent | 3d4489b623deaceef720da7d884a41452f928db6 (diff) |
nix flake metadata: Don't show "Inputs" if there are no inputs
-rw-r--r-- | src/nix/flake.cc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/nix/flake.cc b/src/nix/flake.cc index e01bc6d10..3967f1102 100644 --- a/src/nix/flake.cc +++ b/src/nix/flake.cc @@ -212,7 +212,8 @@ struct CmdFlakeMetadata : FlakeCommand, MixJSON ANSI_BOLD "Last modified:" ANSI_NORMAL " %s", std::put_time(std::localtime(&*lastModified), "%F %T")); - logger->cout(ANSI_BOLD "Inputs:" ANSI_NORMAL); + if (!lockedFlake.lockFile.root->inputs.empty()) + logger->cout(ANSI_BOLD "Inputs:" ANSI_NORMAL); std::unordered_set<std::shared_ptr<Node>> visited; |