mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-12-01 18:16:14 +02:00
Merge pull request #8904 from wentasah/metadata-shows-last-modified
nix flakes metadata: Show lastModified timestamp for each input
This commit is contained in:
commit
6bf68c1e64
1 changed files with 6 additions and 2 deletions
|
@ -233,9 +233,13 @@ struct CmdFlakeMetadata : FlakeCommand, MixJSON
|
||||||
bool last = i + 1 == node.inputs.size();
|
bool last = i + 1 == node.inputs.size();
|
||||||
|
|
||||||
if (auto lockedNode = std::get_if<0>(&input.second)) {
|
if (auto lockedNode = std::get_if<0>(&input.second)) {
|
||||||
logger->cout("%s" ANSI_BOLD "%s" ANSI_NORMAL ": %s",
|
std::string lastModifiedStr = "";
|
||||||
|
if (auto lastModified = (*lockedNode)->lockedRef.input.getLastModified())
|
||||||
|
lastModifiedStr = fmt(" (%s)", std::put_time(std::gmtime(&*lastModified), "%F %T"));
|
||||||
|
logger->cout("%s" ANSI_BOLD "%s" ANSI_NORMAL ": %s%s",
|
||||||
prefix + (last ? treeLast : treeConn), input.first,
|
prefix + (last ? treeLast : treeConn), input.first,
|
||||||
(*lockedNode)->lockedRef);
|
(*lockedNode)->lockedRef,
|
||||||
|
lastModifiedStr);
|
||||||
|
|
||||||
bool firstVisit = visited.insert(*lockedNode).second;
|
bool firstVisit = visited.insert(*lockedNode).second;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue