Skip to content

Commit

Permalink
More resilient parent directory creation #216
Browse files Browse the repository at this point in the history
  • Loading branch information
snoyberg committed Jun 9, 2015
1 parent aa7af6b commit 2773cee
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/Stack/Fetch.hs
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,14 @@ fetchPackages mdistDir toFetchAll = do
newDist = inner FP.</> toFilePath distDir
exists <- doesDirectoryExist oldDist
when exists $ do
createDirectoryIfMissing True $ FP.takeDirectory newDist
-- Previously used takeDirectory, but that got confused
-- by trailing slashes, see:
-- https://github.com/commercialhaskell/stack/issues/216
--
-- Instead, use Path which is a bit more resilient
newDist' <- parseAbsDir newDist
createDirectoryIfMissing True
$ toFilePath $ parent newDist'
renameDirectory oldDist newDist

let cabalFP =
Expand Down

0 comments on commit 2773cee

Please sign in to comment.