summaryrefslogtreecommitdiff
path: root/src/Text/Hakyll/Util.hs
diff options
context:
space:
mode:
authorJasper Van der Jeugt <jaspervdj@gmail.com>2009-12-03 14:14:48 +0100
committerJasper Van der Jeugt <jaspervdj@gmail.com>2009-12-03 14:14:48 +0100
commit3d21d02d65ae809e5a6c117272bc2418226220c9 (patch)
tree3e4c0293b58aaa4f4152a9ccc3938f714ef08bfd /src/Text/Hakyll/Util.hs
parentb7e01c4ca47dc01e7f4f695214d57a3a9f9e1deb (diff)
downloadhakyll-3d21d02d65ae809e5a6c117272bc2418226220c9.tar.gz
Commented Text.Hakyll.Util.
Diffstat (limited to 'src/Text/Hakyll/Util.hs')
-rw-r--r--src/Text/Hakyll/Util.hs10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/Text/Hakyll/Util.hs b/src/Text/Hakyll/Util.hs
index f5a9954..dd84d73 100644
--- a/src/Text/Hakyll/Util.hs
+++ b/src/Text/Hakyll/Util.hs
@@ -1,5 +1,5 @@
module Text.Hakyll.Util
- ( touchDirectories,
+ ( makeDirectories,
getRecursiveContents
) where
@@ -7,10 +7,14 @@ import System.Directory
import System.FilePath
import Control.Monad
-touchDirectories :: FilePath -> IO ()
-touchDirectories path = createDirectoryIfMissing True dir
+-- | Given a path to a file, try to make the path writable by making
+-- all directories on the path.
+makeDirectories :: FilePath -> IO ()
+makeDirectories path = createDirectoryIfMissing True dir
where dir = takeDirectory path
+-- | Get all contents of a directory. Note that files starting with a dot (.)
+-- will be ignored.
getRecursiveContents :: FilePath -> IO [FilePath]
getRecursiveContents topdir = do
names <- getDirectoryContents topdir