Skip to content

Commit

Permalink
nix flake info: Show revcount
Browse files Browse the repository at this point in the history
  • Loading branch information
edolstra committed Apr 19, 2019
1 parent bc25919 commit 50ec2be
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/nix/flake.cc
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ void printFlakeInfo(Flake & flake, bool json) {
j["description"] = flake.description;
if (flake.sourceInfo.rev)
j["revision"] = flake.sourceInfo.rev->to_string(Base16, false);
if (flake.sourceInfo.revCount)
j["revCount"] = *flake.sourceInfo.revCount;
j["path"] = flake.sourceInfo.storePath;
std::cout << j.dump(4) << std::endl;
} else {
Expand All @@ -52,6 +54,8 @@ void printFlakeInfo(Flake & flake, bool json) {
std::cout << "Description: " << flake.description << "\n";
if (flake.sourceInfo.rev)
std::cout << "Revision: " << flake.sourceInfo.rev->to_string(Base16, false) << "\n";
if (flake.sourceInfo.revCount)
std::cout << "Revcount: " << *flake.sourceInfo.revCount << "\n";
std::cout << "Path: " << flake.sourceInfo.storePath << "\n";
}
}
Expand Down

0 comments on commit 50ec2be

Please sign in to comment.