summaryrefslogtreecommitdiff
path: root/lib/Hakyll/Core/Util/String.hs
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Hakyll/Core/Util/String.hs')
-rw-r--r--lib/Hakyll/Core/Util/String.hs7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/Hakyll/Core/Util/String.hs b/lib/Hakyll/Core/Util/String.hs
index f848369..67c436f 100644
--- a/lib/Hakyll/Core/Util/String.hs
+++ b/lib/Hakyll/Core/Util/String.hs
@@ -6,6 +6,7 @@ module Hakyll.Core.Util.String
, replaceAll
, splitAll
, needlePrefix
+ , removeWinPathSeparator
) where
@@ -76,3 +77,9 @@ needlePrefix needle haystack = go [] haystack
go acc xss@(x:xs)
| needle `isPrefixOf` xss = Just $ reverse acc
| otherwise = go (x : acc) xs
+
+
+--------------------------------------------------------------------------------
+-- | Translate native Windows path separators '\\' to '/' if present.
+removeWinPathSeparator :: String -> String
+removeWinPathSeparator = concatMap (\c -> if c == '\\' then ['/'] else [c]) \ No newline at end of file