diff options
Diffstat (limited to '')
-rw-r--r-- | lib/Paths.hs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/Paths.hs b/lib/Paths.hs index b849cf6..83c065f 100644 --- a/lib/Paths.hs +++ b/lib/Paths.hs @@ -68,3 +68,9 @@ isOldStyle (Path _ text frag) = path =~ ("{<.+>*}" :: Text) where path = case frag of Just f -> text <> f _ -> text + +getExtension :: RelPath -> Text +getExtension (Path _ text frag) = case length splitted of + 0 -> "" + _ -> last splitted + where splitted = T.splitOn "." text |