1--------------------------------------------------------------------------------
2-- | A module containing various file utility functions
3module Hakyll.Core.Util.File
9--------------------------------------------------------------------------------
10import Control.Applicative ((<$>))
11import Control.Monad (forM)
12import System.Directory (createDirectoryIfMissing,
13 doesDirectoryExist, getDirectoryContents)
14import System.FilePath (takeDirectory, (</>))
17--------------------------------------------------------------------------------
18-- | Given a path to a file, try to make the path writable by making
19-- all directories on the path.
20makeDirectories :: FilePath -> IO ()
21makeDirectories = createDirectoryIfMissing True . takeDirectory
24--------------------------------------------------------------------------------
25-- | Get all contents of a directory.
26getRecursiveContents :: FilePath -- ^ Directory to search
27 -> IO [FilePath] -- ^ List of files found
28getRecursiveContents top = go ""
30 isProper = (`notElem` [".", ".."])
32 dirExists <- doesDirectoryExist (top </> dir)
36 names <- filter isProper <$> getDirectoryContents (top </> dir)
37 paths <- forM names $ \name -> do
38 let rel = dir </> name
39 isDirectory <- doesDirectoryExist (top </> rel)
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list