From 6bc29b5db2c8de62e2d9f21c25fa8dcd1ec5a75b Mon Sep 17 00:00:00 2001 From: pacien Date: Fri, 27 Dec 2019 10:32:35 +0100 Subject: compiler: extracting funcs --- compiler/src/Files.hs | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'compiler/src/Files.hs') diff --git a/compiler/src/Files.hs b/compiler/src/Files.hs index 0392efe..23daf3a 100644 --- a/compiler/src/Files.hs +++ b/compiler/src/Files.hs @@ -26,7 +26,7 @@ module Files , (), (), localPath, webPath , FSNode(..), AnchoredFSNode(..) , nodePath, nodeName, isHidden, flattenDir, filterDir, readDirectory - , ensureParentDir + , ensureParentDir, remove ) where @@ -34,7 +34,11 @@ import Control.Monad (filterM, mapM) import Data.Bool (bool) import Data.List (isPrefixOf, length, deleteBy) import Data.Function ((&)) -import System.Directory (doesDirectoryExist, listDirectory, createDirectoryIfMissing) +import System.Directory + ( doesDirectoryExist + , listDirectory + , createDirectoryIfMissing + , removePathForcibly ) import qualified System.FilePath import qualified System.FilePath.Posix @@ -118,3 +122,9 @@ ensureParentDir writer filePath a = >> writer filePath a where parentDir = System.FilePath.dropFileName filePath + +remove :: FileName -> IO () +remove path = + do + putStrLn $ "Removing:\t" ++ path + removePathForcibly path -- cgit v1.2.3