mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-10 16:26:18 +02:00
writeLockFile(): Emit empty objects rather than null
This commit is contained in:
parent
ed9d725392
commit
e1d73edb10
1 changed files with 2 additions and 1 deletions
|
@ -114,9 +114,10 @@ void writeLockFile(LockFile lockFile, Path path)
|
||||||
{
|
{
|
||||||
nlohmann::json json;
|
nlohmann::json json;
|
||||||
json["version"] = 1;
|
json["version"] = 1;
|
||||||
json["nonFlakeRequires"];
|
json["nonFlakeRequires"] = nlohmann::json::object();
|
||||||
for (auto & x : lockFile.nonFlakeEntries)
|
for (auto & x : lockFile.nonFlakeEntries)
|
||||||
json["nonFlakeRequires"][x.first]["uri"] = x.second.to_string();
|
json["nonFlakeRequires"][x.first]["uri"] = x.second.to_string();
|
||||||
|
json["requires"] = nlohmann::json::object();
|
||||||
for (auto & x : lockFile.flakeEntries)
|
for (auto & x : lockFile.flakeEntries)
|
||||||
json["requires"][x.first] = flakeEntryToJson(x.second);
|
json["requires"][x.first] = flakeEntryToJson(x.second);
|
||||||
createDirs(dirOf(path));
|
createDirs(dirOf(path));
|
||||||
|
|
Loading…
Reference in a new issue