diff options
author | Eelco Dolstra <edolstra@gmail.com> | 2019-04-16 14:23:10 +0200 |
---|---|---|
committer | Eelco Dolstra <edolstra@gmail.com> | 2019-04-16 14:23:10 +0200 |
commit | e1d73edb10ca38184c85b3124b4c59c6f04a0851 (patch) | |
tree | 2337f0b8c431afec857767e8663af74cfd9eb096 /src | |
parent | ed9d725392827ee1516ca90ca891b2e7a66b2859 (diff) |
writeLockFile(): Emit empty objects rather than null
Diffstat (limited to 'src')
-rw-r--r-- | src/libexpr/primops/flake.cc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/libexpr/primops/flake.cc b/src/libexpr/primops/flake.cc index 32874f87b..f65ae09ea 100644 --- a/src/libexpr/primops/flake.cc +++ b/src/libexpr/primops/flake.cc @@ -114,9 +114,10 @@ void writeLockFile(LockFile lockFile, Path path) { nlohmann::json json; json["version"] = 1; - json["nonFlakeRequires"]; + json["nonFlakeRequires"] = nlohmann::json::object(); for (auto & x : lockFile.nonFlakeEntries) json["nonFlakeRequires"][x.first]["uri"] = x.second.to_string(); + json["requires"] = nlohmann::json::object(); for (auto & x : lockFile.flakeEntries) json["requires"][x.first] = flakeEntryToJson(x.second); createDirs(dirOf(path)); |