aboutsummaryrefslogtreecommitdiff
path: root/src/nix/flake.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/nix/flake.cc')
-rw-r--r--src/nix/flake.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/nix/flake.cc b/src/nix/flake.cc
index 5bec5903f..bfff682d9 100644
--- a/src/nix/flake.cc
+++ b/src/nix/flake.cc
@@ -80,7 +80,8 @@ static void printFlakeInfo(const Store & store, const Flake & flake)
{
std::cout << fmt("URL: %s\n", flake.resolvedRef.input->to_string());
std::cout << fmt("Edition: %s\n", flake.edition);
- std::cout << fmt("Description: %s\n", flake.description);
+ if (flake.description)
+ std::cout << fmt("Description: %s\n", *flake.description);
std::cout << fmt("Path: %s\n", store.printStorePath(flake.sourceInfo->storePath));
if (flake.sourceInfo->rev)
std::cout << fmt("Revision: %s\n", flake.sourceInfo->rev->to_string(Base16, false));
@@ -94,7 +95,8 @@ static void printFlakeInfo(const Store & store, const Flake & flake)
static nlohmann::json flakeToJson(const Store & store, const Flake & flake)
{
nlohmann::json j;
- j["description"] = flake.description;
+ if (flake.description)
+ j["description"] = *flake.description;
j["edition"] = flake.edition;
j["url"] = flake.resolvedRef.input->to_string();
if (flake.sourceInfo->rev)