logf: don't call jq's gsub with empty regex :)

This commit is contained in:
tv 2016-08-11 21:01:51 +02:00
parent c31c4e48b0
commit 524601b974

View File

@ -54,7 +54,8 @@ pkgs.writeDashBin "logf" ''
# anaphoric gsub
def agsub(re; f):
gsub("(?<it>\(re))"; .it | f);
# Don't try empty regex: https://github.com/stedolan/jq/issues/1206
when(re != ""; gsub("(?<it>\(re))"; .it | f));
# :: [int] -> sgr
def sgr: "\u001b[\(map(tostring) | join(";"))m";