aboutsummaryrefslogtreecommitdiff
path: root/compiler/src/Files.hs
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/src/Files.hs')
-rw-r--r--compiler/src/Files.hs14
1 files changed, 12 insertions, 2 deletions
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
26 , (</>), (</), (/>), localPath, webPath 26 , (</>), (</), (/>), localPath, webPath
27 , FSNode(..), AnchoredFSNode(..) 27 , FSNode(..), AnchoredFSNode(..)
28 , nodePath, nodeName, isHidden, flattenDir, filterDir, readDirectory 28 , nodePath, nodeName, isHidden, flattenDir, filterDir, readDirectory
29 , ensureParentDir 29 , ensureParentDir, remove
30 ) where 30 ) where
31 31
32 32
@@ -34,7 +34,11 @@ import Control.Monad (filterM, mapM)
34import Data.Bool (bool) 34import Data.Bool (bool)
35import Data.List (isPrefixOf, length, deleteBy) 35import Data.List (isPrefixOf, length, deleteBy)
36import Data.Function ((&)) 36import Data.Function ((&))
37import System.Directory (doesDirectoryExist, listDirectory, createDirectoryIfMissing) 37import System.Directory
38 ( doesDirectoryExist
39 , listDirectory
40 , createDirectoryIfMissing
41 , removePathForcibly )
38 42
39import qualified System.FilePath 43import qualified System.FilePath
40import qualified System.FilePath.Posix 44import qualified System.FilePath.Posix
@@ -118,3 +122,9 @@ ensureParentDir writer filePath a =
118 >> writer filePath a 122 >> writer filePath a
119 where 123 where
120 parentDir = System.FilePath.dropFileName filePath 124 parentDir = System.FilePath.dropFileName filePath
125
126remove :: FileName -> IO ()
127remove path =
128 do
129 putStrLn $ "Removing:\t" ++ path
130 removePathForcibly path