summaryrefslogtreecommitdiff
path: root/lib/Paths.hs
diff options
context:
space:
mode:
authorstuebinm2021-12-13 23:50:09 +0100
committerstuebinm2021-12-13 23:56:02 +0100
commit204d3f4a393cc1be5d0872e6fd53d014ede191a5 (patch)
treed459123dbbf00c8eda59cdcfe3c360fb1f68750e /lib/Paths.hs
parentea6ef98353669ece25c6366bfdbc5bb921a44b7a (diff)
complain if map links that don't go to .json files
Diffstat (limited to '')
-rw-r--r--lib/Paths.hs6
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