diff --git a/yesod/scaffold/config/Settings.hs.cg b/yesod/scaffold/config/Settings.hs.cg index 17e3ce08..c5f7c53a 100644 --- a/yesod/scaffold/config/Settings.hs.cg +++ b/yesod/scaffold/config/Settings.hs.cg @@ -172,12 +172,12 @@ juliusFile = widgetFile :: FilePath -> Q Exp widgetFile x = do - let h = unlessExists (globFile "hamlet") (whamletFile . globFile "hamlet") - let c = unlessExists (globFile "cassius") cassiusFile - let j = unlessExists (globFile "julius") juliusFile - let l = unlessExists (globFile "lucius") luciusFile + let h = whenExists (globFile "hamlet") (whamletFile . globFile "hamlet") + let c = whenExists (globFile "cassius") cassiusFile + let j = whenExists (globFile "julius") juliusFile + let l = whenExists (globFile "lucius") luciusFile [|addWidget $h >> addCassius $c >> addJulius $j >> addLucius $l|] where - unlessExists tofn f = do + whenExists tofn f = do e <- qRunIO $ doesFileExist $ tofn x if e then f x else [|mempty|] diff --git a/yesod/scaffold/tiny/config/Settings.hs.cg b/yesod/scaffold/tiny/config/Settings.hs.cg index 3ab13fcb..558d519c 100644 --- a/yesod/scaffold/tiny/config/Settings.hs.cg +++ b/yesod/scaffold/tiny/config/Settings.hs.cg @@ -142,12 +142,12 @@ juliusFile = H.juliusFileDebug . toJuliusFile widgetFile :: FilePath -> Q Exp widgetFile x = do - let h = unlessExists toHamletFile $ whamletFile . toHamletFile - let c = unlessExists toCassiusFile cassiusFile - let j = unlessExists toJuliusFile juliusFile - let l = unlessExists toLuciusFile luciusFile + let h = whenExists toHamletFile $ whamletFile . toHamletFile + let c = whenExists toCassiusFile cassiusFile + let j = whenExists toJuliusFile juliusFile + let l = whenExists toLuciusFile luciusFile [|addWidget $h >> addCassius $c >> addJulius $j >> addLucius $l|] where - unlessExists tofn f = do + whenExists tofn f = do e <- qRunIO $ doesFileExist $ tofn x if e then f x else [|mempty|]