Browse Source

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

travis
Julian Ospald 4 years ago
parent
commit
0c770be3a5
No known key found for this signature in database GPG Key ID: 511B62C09D50CD28
1 changed files with 7 additions and 7 deletions
  1. +7
    -7
      hpath-directory/src/System/Posix/RawFilePath/Directory.hs

+ 7
- 7
hpath-directory/src/System/Posix/RawFilePath/Directory.hs View File

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

case ft of
RegularFile -> do


Loading…
Cancel
Save