diff options
Diffstat (limited to 'compiler/src/Files.hs')
-rw-r--r-- | compiler/src/Files.hs | 14 |
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) | |||
34 | import Data.Bool (bool) | 34 | import Data.Bool (bool) |
35 | import Data.List (isPrefixOf, length, deleteBy) | 35 | import Data.List (isPrefixOf, length, deleteBy) |
36 | import Data.Function ((&)) | 36 | import Data.Function ((&)) |
37 | import System.Directory (doesDirectoryExist, listDirectory, createDirectoryIfMissing) | 37 | import System.Directory |
38 | ( doesDirectoryExist | ||
39 | , listDirectory | ||
40 | , createDirectoryIfMissing | ||
41 | , removePathForcibly ) | ||
38 | 42 | ||
39 | import qualified System.FilePath | 43 | import qualified System.FilePath |
40 | import qualified System.FilePath.Posix | 44 | import 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 | |||
126 | remove :: FileName -> IO () | ||
127 | remove path = | ||
128 | do | ||
129 | putStrLn $ "Removing:\t" ++ path | ||
130 | removePathForcibly path | ||