aboutsummaryrefslogtreecommitdiff
path: root/compiler/src/Files.hs
diff options
context:
space:
mode:
authorpacien2019-12-27 10:32:35 +0100
committerpacien2019-12-27 10:32:35 +0100
commit6bc29b5db2c8de62e2d9f21c25fa8dcd1ec5a75b (patch)
treefcc5bfee9ae1c14f9d2e3c7a6d38e82825d14d10 /compiler/src/Files.hs
parent015d793b25a3f0d1ff275ed42ec211dd6a532ca0 (diff)
downloadldgallery-6bc29b5db2c8de62e2d9f21c25fa8dcd1ec5a75b.tar.gz
compiler: extracting funcs
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