Skip to content

Commit

Permalink
Update src/nix/search.cc
Browse files Browse the repository at this point in the history
Co-authored-by: Jörg Thalheim <[email protected]>
  • Loading branch information
edolstra and Mic92 committed May 7, 2020
1 parent 1ad71bc commit 14a3a62
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/nix/search.cc
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ struct CmdSearch : InstallableCommand, MixJSON
for (auto & [cursor, prefix] : installable->getCursor(*state, true))
visit(*cursor, parseAttrPath(*state, prefix));

if (!results)
if (!json && !results)
throw Error("no results for the given search term(s)!");
}
};
Expand Down

0 comments on commit 14a3a62

Please sign in to comment.