Don't run toAbs manually, doesn't make sense

This commit is contained in:
Julian Ospald 2020-01-26 21:48:08 +01:00
parent f3f232e4c9
commit 0c770be3a5
No known key found for this signature in database
GPG Key ID: 511B62C09D50CD28
1 changed files with 7 additions and 7 deletions

View File

@ -480,9 +480,9 @@ recreateSymlink symsource newsym cm
case cm of case cm of
Strict -> return () Strict -> return ()
Overwrite -> do Overwrite -> do
writable <- toAbs newsym >>= (\p -> do writable <- do
e <- doesExist p e <- doesExist newsym
if e then isWritable p else pure False) if e then isWritable newsym else pure False
isfile <- doesFileExist newsym isfile <- doesFileExist newsym
isdir <- doesDirectoryExist newsym isdir <- doesDirectoryExist newsym
when (writable && isfile) (deleteFile newsym) when (writable && isfile) (deleteFile newsym)
@ -770,7 +770,7 @@ createDirIfMissing fm destBS =
-- Note: calls `getcwd` if the input path is a relative path -- Note: calls `getcwd` if the input path is a relative path
createDirRecursive :: FileMode -> RawFilePath -> IO () createDirRecursive :: FileMode -> RawFilePath -> IO ()
createDirRecursive fm p = createDirRecursive fm p =
toAbs p >>= go go p
where where
go :: RawFilePath -> IO () go :: RawFilePath -> IO ()
go dest = do go dest = do
@ -879,9 +879,9 @@ moveFile from to cm = do
easyDelete from easyDelete from
Overwrite -> do Overwrite -> do
ft <- getFileType from ft <- getFileType from
writable <- toAbs to >>= (\p -> do writable <- do
e <- doesFileExist p e <- doesFileExist to
if e then isWritable p else pure False) if e then isWritable to else pure False
case ft of case ft of
RegularFile -> do RegularFile -> do