LIB: make deleteDirRecursive a little bit more safer

This commit is contained in:
Julian Ospald 2015-12-27 20:00:28 +01:00
parent 5d44243689
commit a81ef6a38c
No known key found for this signature in database
GPG Key ID: 220CD1C5BDEED020

View File

@ -318,7 +318,8 @@ deleteDirRecursive f@(_ :/ Dir {}) = do
case file of
(_ :/ SymLink {}) -> deleteSymlink file
(_ :/ Dir {}) -> deleteDirRecursive file
(_ :/ f) -> removeLink (fullPath file)
(AFileLike _) -> removeLink (fullPath file)
_ -> throw $ FileDoesExist (fullPath file)
removeDirectory fp
deleteDirRecursive _ = throw $ InvalidOperation "wrong input type"