From a81ef6a38cd8997b02380fb4e64119858e1f9e14 Mon Sep 17 00:00:00 2001 From: Julian Ospald Date: Sun, 27 Dec 2015 20:00:28 +0100 Subject: [PATCH] LIB: make deleteDirRecursive a little bit more safer --- src/IO/File.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/IO/File.hs b/src/IO/File.hs index de24d17..190b279 100644 --- a/src/IO/File.hs +++ b/src/IO/File.hs @@ -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"