1
0
Fork 0

Support empty strings in removeTrailingWhitespace

This commit is contained in:
Nicolas Jeannerod 2025-02-21 15:13:38 +01:00
parent 722afdc5ea
commit 7c639fc131
Signed by untrusted user: Niols
GPG key ID: 35DB9EC8886E1CB8

View file

@ -18,7 +18,12 @@ let
maybeMatch = match "(.*)\.pub" s;
in
if maybeMatch == null then s else elemAt maybeMatch 0;
removeTrailingWhitespace = s: elemAt (match "(.*[^[:space:]])[[:space:]]*" s) 0;
removeTrailingWhitespace =
s:
let
maybeMatch = match "(.*[^[:space:]])[[:space:]]*" s;
in
if maybeMatch == null then "" else elemAt maybeMatch 0;
collectKeys =
dir: