Compare commits
2 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
3e0ef6be70 | ||
|
af6516a454 |
@ -85,10 +85,6 @@ import Safe
|
|||||||
atDef
|
atDef
|
||||||
, initDef
|
, initDef
|
||||||
)
|
)
|
||||||
import System.Directory
|
|
||||||
(
|
|
||||||
canonicalizePath
|
|
||||||
)
|
|
||||||
import System.FilePath
|
import System.FilePath
|
||||||
(
|
(
|
||||||
combine
|
combine
|
||||||
@ -598,18 +594,6 @@ normalize fp =
|
|||||||
ff x y = x ++ [y]
|
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: ----
|
---- IO HELPERS: ----
|
||||||
|
|
||||||
|
@ -407,6 +407,7 @@ moveFile from to@(_ :/ Dir {}) = do
|
|||||||
to' = fullPath to </> (name . file $ from)
|
to' = fullPath to </> (name . file $ from)
|
||||||
throwFileDoesExist to'
|
throwFileDoesExist to'
|
||||||
throwSameFile from' to'
|
throwSameFile from' to'
|
||||||
|
-- TODO: don't catch all exceptions!
|
||||||
handle (\(SomeException e) -> do
|
handle (\(SomeException e) -> do
|
||||||
easyCopy Strict from to
|
easyCopy Strict from to
|
||||||
easyDelete from
|
easyDelete from
|
||||||
|
Loading…
Reference in New Issue
Block a user