logf: don't call jq's gsub with empty regex :)
This commit is contained in:
parent
c31c4e48b0
commit
524601b974
@ -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";
|
||||
|
Loading…
Reference in New Issue
Block a user