mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-10 16:26:18 +02:00
nix flakes metadata: Show lastModified timestamp for each input
Before this commit, the output of `nix flake metadata` in nix repo looked like this: ... Last modified: 2023-07-09 16:00:16 Inputs: ├───flake-compat: github:edolstra/flake-compat/35bb57c0c8d8b62bbfd284272c928ceb64ddbde9 ├───lowdown-src: github:kristapsdz/lowdown/d2c2b44ff6c27b936ec27358a2653caaef8f73b8 ├───nixpkgs: github:NixOS/nixpkgs/04a75b2eecc0acf6239acf9dd04485ff8d14f425 └───nixpkgs-regression: github:NixOS/nixpkgs/215d4d0fd80ca5163643b03a33fde804a29cc1e2 This commit changes that to: ... Last modified: 2023-07-09 16:00:16 Inputs: ├───flake-compat: github:edolstra/flake-compat/35bb57c0c8d8b62bbfd284272c928ceb64ddbde9 (2023-01-17 11:47:33) ├───lowdown-src: github:kristapsdz/lowdown/d2c2b44ff6c27b936ec27358a2653caaef8f73b8 (2021-10-06 10:00:07) ├───nixpkgs: github:NixOS/nixpkgs/04a75b2eecc0acf6239acf9dd04485ff8d14f425 (2022-12-08 01:04:00) └───nixpkgs-regression: github:NixOS/nixpkgs/215d4d0fd80ca5163643b03a33fde804a29cc1e2 (2022-01-24 19:20:45)
This commit is contained in:
parent
4a8c9bb9aa
commit
3ae1489847
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