Make sure that all directories in build/ are properly constructed
commitcc81b1e22b25b684d544863d9f4ddeba366e672e
authorEvan Czaplicki <info@elm-lang.org>
dateTue 6 Aug 2013, 22:51 (13 years ago)
parentf7db7a3
compiler/Compiler.hs+3−1
@@ -189,7 +189,9 @@ build flags rootFile = do
189189 putStr "Generating HTML ... "
190190 runtime <- getRuntime flags
191191 let html = genHtml $ createHtml runtime (takeBaseName rootFile) (sources js) moduleName ""
192− writeFile (buildPath flags rootFile "html") html
192+ htmlFile = buildPath flags rootFile "html"
193+ createDirectoryIfMissing True (takeDirectory htmlFile)
194+ writeFile htmlFile html
193195 putStrLn "Done"
194196
195197 where