nix flake metadata: Don't show "Inputs" if there are no inputs

This commit is contained in:
Eelco Dolstra 2022-08-16 14:58:08 +02:00
parent 78bd377594
commit 4adb32f7d5

View file

@ -208,7 +208,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;