diff options
author | Hugo Hörnquist <hugo@lysator.liu.se> | 2023-01-29 17:37:37 +0100 |
---|---|---|
committer | Hugo Hörnquist <hugo@lysator.liu.se> | 2023-01-29 17:37:37 +0100 |
commit | 80ea14aff671b29e34a4653b45d6b7c5598db3bb (patch) | |
tree | 19a2b2c131f298fb795e2279029f146dcfc2b660 /functions | |
parent | Initial commit. (diff) | |
download | xorg-master.tar.gz xorg-master.tar.xz |
Diffstat (limited to 'functions')
-rw-r--r-- | functions/normalize_filename.pp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/functions/normalize_filename.pp b/functions/normalize_filename.pp new file mode 100644 index 0000000..6910936 --- /dev/null +++ b/functions/normalize_filename.pp @@ -0,0 +1,7 @@ +# Should take any string, and replace all non-character letters with +# dashes, and downcase everything. +function xorg::normalize_filename ( + String $name, +) >> String { + $name.downcase().regsubst(/[^a-z0-9]/, '-') +} |