@@ -99,8 +99,9 @@ embedFileRelative = embedFile <=< makeRelativeToProject
99
99
100
100
-- | Maybe embed a single file in your source code depending on whether or not file exists.
101
101
--
102
- -- Warning: When a build is compiled with the file missing, a recompile when the file exists might not trigger an embed of the file.
103
- -- You might try to fix this by doing a clean build.
102
+ -- Warning: When a build is compiled with the file missing, a recompile when the
103
+ -- file exists might not trigger an embed of the file. You might try to fix this
104
+ -- by doing a clean build or using GHC's -fforce-recomp flag.
104
105
--
105
106
-- > import qualified Data.ByteString
106
107
-- >
@@ -120,13 +121,18 @@ embedFileIfExists fp = do
120
121
[| Just $ (bsToExp bs) | ]
121
122
where
122
123
maybeFile :: IO (Maybe B. ByteString )
123
- maybeFile =
124
- either (const Nothing ) Just <$>
124
+ maybeFile =
125
+ either (const Nothing ) Just <$>
125
126
tryJust (guard . isDoesNotExistError) (B. readFile fp)
126
127
127
128
-- | Embed a single existing file in your source code
128
129
-- out of list a list of paths supplied.
129
130
--
131
+ -- Warning: When a build is compiled with initial file(s) in the list missing, a
132
+ -- recompile when one of those files exists might not trigger an embed of the
133
+ -- first such file. You might try to fix this by doing a clean build or using
134
+ -- GHC's -fforce-recomp flag.
135
+ --
130
136
-- > import qualified Data.ByteString
131
137
-- >
132
138
-- > myFile :: Data.ByteString.ByteString
@@ -148,6 +154,11 @@ embedOneFileOf ps =
148
154
149
155
-- | Embed a directory recursively in your source code.
150
156
--
157
+ -- Warning: When a build is compiled with a file missing from the directory, a
158
+ -- recompile when that file is added might not trigger an embed of the file. You
159
+ -- might try to fix this by doing a clean build or using GHC's -fforce-recomp
160
+ -- flag.
161
+ --
151
162
-- > import qualified Data.ByteString
152
163
-- >
153
164
-- > myDir :: [(FilePath, Data.ByteString.ByteString)]
@@ -231,6 +242,11 @@ embedStringFile fp =
231
242
-- | Embed a single existing string file in your source code
232
243
-- out of list a list of paths supplied.
233
244
--
245
+ -- Warning: When a build is compiled with initial file(s) in the list missing, a
246
+ -- recompile when one of those files exists might not trigger an embed of the
247
+ -- first such file. You might try to fix this by doing a clean build or using
248
+ -- GHC's -fforce-recomp flag.
249
+ --
234
250
-- Since 0.0.9
235
251
embedOneStringFileOf :: [FilePath ] -> Q Exp
236
252
embedOneStringFileOf ps =
0 commit comments