Properly generate directory structure
This commit is contained in:
parent
ae5ef9db97
commit
0976355fac
1 changed files with 3 additions and 3 deletions
|
@ -41,9 +41,9 @@ parseFile path = do
|
||||||
case iParse docs "" source of
|
case iParse docs "" source of
|
||||||
Right json -> do
|
Right json -> do
|
||||||
putStrLn $ "Documenting " ++ path
|
putStrLn $ "Documenting " ++ path
|
||||||
createDirectoryIfMissing True "docs"
|
let docPath = "docs" </> replaceExtension path ".json"
|
||||||
BS.writeFile ("docs" </> replaceExtension path ".json")
|
createDirectoryIfMissing True (dropFileName docPath)
|
||||||
(encodePretty' (defConfig { confIndent = 2 }) json)
|
BS.writeFile docPath (encodePretty' (defConfig { confIndent = 2 }) json)
|
||||||
Left err -> do
|
Left err -> do
|
||||||
putStrLn $ "Parse error in " ++ path ++ " at " ++ show err
|
putStrLn $ "Parse error in " ++ path ++ " at " ++ show err
|
||||||
exitFailure
|
exitFailure
|
||||||
|
|
Loading…
Reference in a new issue