Compare commits

...

2 Commits

Author SHA1 Message Date
hasufell
3e0ef6be70 LIB: add TODO 2015-12-27 05:31:27 +01:00
hasufell
af6516a454 LIB: rm unneded import 2015-12-27 05:31:19 +01:00
2 changed files with 1 additions and 16 deletions

View File

@ -85,10 +85,6 @@ import Safe
atDef
, initDef
)
import System.Directory
(
canonicalizePath
)
import System.FilePath
(
combine
@ -598,18 +594,6 @@ normalize fp =
ff x y = x ++ [y]
-- |Like `canonicalizePath` from System.Directory, but preserves the last
-- component if it's a symlink.
canonicalizePath' :: FilePath -> IO FilePath
canonicalizePath' fp = do
-- TODO: throw fileDoesNotExist error earlier
isSymlink <- PF.isSymbolicLink <$> PF.getSymbolicLinkStatus fp
if isSymlink
then do
cbase <- canonicalizePath (baseDir fp)
return $ cbase </> topDir fp
else canonicalizePath fp
---- IO HELPERS: ----

View File

@ -407,6 +407,7 @@ moveFile from to@(_ :/ Dir {}) = do
to' = fullPath to </> (name . file $ from)
throwFileDoesExist to'
throwSameFile from' to'
-- TODO: don't catch all exceptions!
handle (\(SomeException e) -> do
easyCopy Strict from to
easyDelete from