Merge pull request #3570 from Mic92/nix-search

nix/search: no error for empty search results if json is enabled
This commit is contained in:
Domen Kožar 2020-05-06 16:14:58 +02:00 committed by GitHub
commit 672985531c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -265,7 +265,7 @@ struct CmdSearch : SourceExprCommand, MixJSON
throw SysError("cannot rename '%s' to '%s'", tmpFile, jsonCacheFileName);
}
if (results.size() == 0)
if (!json && results.size() == 0)
throw Error("no results for the given search term(s)!");
RunPager pager;