I am using a simple text file to generate some code with TemplateHaskell and runIO.
...
curdir <- runIO $ getCurrentDirectory
addDependentFile $ curdir ++ "/spec.txt"
bs <- runIO $ BS.readFile "spec.txt"
...
Everything works fine when used with ghci. The problem is that cabal has no idea that I need this file to create, and I get it when I do cabal build.
Exception when trying to run compile-time code:
spec.txt: openFile: does not exist (No such file or directory)
source
share