made parentDir return a Maybe FilePath; removed most uses of it
parentDir is less safe than takeDirectory, especially when working with relative FilePaths. It's really only useful in loops that want to terminate at / This commit was sponsored by Audric SCHILTKNECHT.
This commit is contained in:
parent
d09a198ec0
commit
965e106f24
47 changed files with 97 additions and 96 deletions
|
@ -204,7 +204,7 @@ applySplices destdir imports splices@(first:_) = do
|
|||
let f = splicedFile first
|
||||
let dest = (destdir </> f)
|
||||
lls <- map (++ "\n") . lines <$> readFileStrictAnyEncoding f
|
||||
createDirectoryIfMissing True (parentDir dest)
|
||||
createDirectoryIfMissing True (takeDirectory dest)
|
||||
let newcontent = concat $ addimports $ expand lls splices
|
||||
oldcontent <- catchMaybeIO $ readFileStrictAnyEncoding dest
|
||||
when (oldcontent /= Just newcontent) $ do
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue