mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-12-02 02:16:15 +02:00
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
1 changed files with 1 additions and 1 deletions
|
@ -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