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
|
||||
Right json -> do
|
||||
putStrLn $ "Documenting " ++ path
|
||||
createDirectoryIfMissing True "docs"
|
||||
BS.writeFile ("docs" </> replaceExtension path ".json")
|
||||
(encodePretty' (defConfig { confIndent = 2 }) json)
|
||||
let docPath = "docs" </> replaceExtension path ".json"
|
||||
createDirectoryIfMissing True (dropFileName docPath)
|
||||
BS.writeFile docPath (encodePretty' (defConfig { confIndent = 2 }) json)
|
||||
Left err -> do
|
||||
putStrLn $ "Parse error in " ++ path ++ " at " ++ show err
|
||||
exitFailure
|
||||
|
|
Loading…
Reference in a new issue