forked from lix-project/lix
nix/search: no error for empty search results if json is enabled
- result list will be always empty if --json is passed - for scripts an empty search result is not really an error, we rather want to distinguish between evaluation errors and empty results
This commit is contained in:
parent
a721a0b114
commit
85c1932c94
|
@ -265,7 +265,7 @@ struct CmdSearch : SourceExprCommand, MixJSON
|
||||||
throw SysError("cannot rename '%s' to '%s'", tmpFile, jsonCacheFileName);
|
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)!");
|
throw Error("no results for the given search term(s)!");
|
||||||
|
|
||||||
RunPager pager;
|
RunPager pager;
|
||||||
|
|
Loading…
Reference in a new issue