LIB: fix IOError in copyFile

The destination file does not exist yet so we cannot canonicalize
it's full path, only part of it.
This commit is contained in:
Julian Ospald 2015-12-21 05:50:19 +01:00
parent 0867c8b2e3
commit 89157bc0d9
No known key found for this signature in database
GPG Key ID: 220CD1C5BDEED020

View File

@ -205,7 +205,8 @@ copyFile :: FilePath -- ^ source file
-> IO ()
copyFile from' to' = do
from <- canonicalizePath from'
to <- canonicalizePath to'
tod <- canonicalizePath (baseDir to')
let to = tod </> takeFileName to'
fileSanityThrow from
throwNotAbsolute to
throwDirDoesExist to