LIB: make recreateSymlink more robust
This commit is contained in:
parent
433cb164a6
commit
773cb100b4
@ -192,14 +192,15 @@ copyDir cm from' to' = do
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
-- |Recreate a symlink. Don't call `canonicalizePath` on the symlink
|
-- |Recreate a symlink.
|
||||||
-- destination since that will mess with the symlink.
|
|
||||||
recreateSymlink :: FilePath -- ^ the old symlink file
|
recreateSymlink :: FilePath -- ^ the old symlink file
|
||||||
-> FilePath -- ^ destination of the new symlink file
|
-> FilePath -- ^ destination of the new symlink file
|
||||||
-> IO ()
|
-> IO ()
|
||||||
recreateSymlink symf' symdest = do
|
recreateSymlink symf' symdest' = do
|
||||||
symf <- canonicalizePath' symf'
|
symf <- canonicalizePath' symf'
|
||||||
symname <- readSymbolicLink symf
|
symname <- readSymbolicLink symf
|
||||||
|
symdestd <- canonicalizePath' (baseDir symdest')
|
||||||
|
let symdest = symdestd </> takeFileName symdest'
|
||||||
createSymbolicLink symname symdest
|
createSymbolicLink symname symdest
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user