Workaround for problem with file-embed.
file-embed uses forward slashes as path separators, even on Windows. So we just convert backslashes to forward before doing a lookup.
This commit is contained in:
parent
a00c0344d8
commit
84ed0f055f
1 changed files with 3 additions and 1 deletions
|
@ -512,10 +512,12 @@ dataFiles = $(embedDir "data")
|
|||
readDefaultDataFile :: FilePath -> IO B.ByteString
|
||||
readDefaultDataFile fname =
|
||||
#ifdef EMBED_DATA_FILES
|
||||
case lookup fname dataFiles of
|
||||
case lookup (map backToForwardSlash fname) dataFiles of
|
||||
Nothing -> ioError $ userError
|
||||
$ "Data file `" ++ fname ++ "' does not exist"
|
||||
Just contents -> return contents
|
||||
where backToForwardSlash '\\' = '/'
|
||||
backToForwardSlash c = c
|
||||
#else
|
||||
getDataFileName ("data" </> fname) >>= B.readFile
|
||||
#endif
|
||||
|
|
Loading…
Reference in a new issue