diff options
author | stuebinm | 2021-12-13 23:50:09 +0100 |
---|---|---|
committer | stuebinm | 2021-12-13 23:56:02 +0100 |
commit | 204d3f4a393cc1be5d0872e6fd53d014ede191a5 (patch) | |
tree | d459123dbbf00c8eda59cdcfe3c360fb1f68750e /lib/Paths.hs | |
parent | ea6ef98353669ece25c6366bfdbc5bb921a44b7a (diff) |
complain if map links that don't go to .json files
Diffstat (limited to 'lib/Paths.hs')
-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 |