Doh
This commit is contained in:
parent
021634e3e3
commit
00e1400eb7
26
src/libfetchers/tree-info.cc
Normal file
26
src/libfetchers/tree-info.cc
Normal file
|
@ -0,0 +1,26 @@
|
|||
#include "tree-info.hh"
|
||||
#include "store-api.hh"
|
||||
|
||||
#include <nlohmann/json.hpp>
|
||||
|
||||
namespace nix::fetchers {
|
||||
|
||||
StorePath TreeInfo::computeStorePath(Store & store) const
|
||||
{
|
||||
assert(narHash);
|
||||
return store.makeFixedOutputPath(true, narHash, "source");
|
||||
}
|
||||
|
||||
nlohmann::json TreeInfo::toJson() const
|
||||
{
|
||||
nlohmann::json json;
|
||||
assert(narHash);
|
||||
json["narHash"] = narHash.to_string(SRI);
|
||||
if (revCount)
|
||||
json["revCount"] = *revCount;
|
||||
if (lastModified)
|
||||
json["lastModified"] = *lastModified;
|
||||
return json;
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in a new issue