on master help sign in
Properly generate directory structure
commit0976355fac368f659f15be929c5b42a052c66b27 authorEvan Czaplicki <info@elm-lang.org> dateThu 5 Sep 2013, 10:55 (13 years ago) parentae5ef9d
1 file changed+3−3
compiler/Docs.hs+3−3
compiler/Docs.hs+3−3
@@ -41,9 +41,9 @@ parseFile path = do
4141 case iParse docs "" source of
4242 Right json -> do
4343 putStrLn $ "Documenting " ++ path
44− createDirectoryIfMissing True "docs"
45− BS.writeFile ("docs" </> replaceExtension path ".json")
46− (encodePretty' (defConfig { confIndent = 2 }) json)
44+ let docPath = "docs" </> replaceExtension path ".json"
45+ createDirectoryIfMissing True (dropFileName docPath)
46+ BS.writeFile docPath (encodePretty' (defConfig { confIndent = 2 }) json)
4747 Left err -> do
4848 putStrLn $ "Parse error in " ++ path ++ " at " ++ show err
4949 exitFailure