add split-filename

This commit is contained in:
James Andariese 2022-10-17 10:42:15 -05:00
parent 5b510c550d
commit 7a6b833148

7
split-filename.nix Normal file
View File

@ -0,0 +1,7 @@
with builtins;
f:
let mr = match "(.*)[.]([^.]*)|(.*)" f;
in if head mr == null
then { name = (elemAt mr 2); extension = null; }
else { name = (elemAt mr 0); extension = (elemAt mr 1); }