@@ -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