diff --git a/src/Vervis.hs b/src/Vervis.hs index c2db79b..3c698cc 100644 --- a/src/Vervis.hs +++ b/src/Vervis.hs @@ -14,6 +14,19 @@ -} module Vervis - ( + ( subdirs ) where + +import Data.Maybe (mapMaybe) +import System.Directory.Tree + +subdirs :: FilePath -> IO [FilePath] +subdirs dir = do + _base :/ tree <- buildL dir + return $ case tree of + Dir _ cs -> + let dirName (Dir n _) = Just n + dirName _ = Nothing + in mapMaybe dirName cs + _ -> [] diff --git a/vervis.cabal b/vervis.cabal index 03138aa..10a8a20 100644 --- a/vervis.cabal +++ b/vervis.cabal @@ -29,7 +29,8 @@ library exposed-modules: Vervis -- other-modules: -- other-extensions: - build-depends: base >=4.8 && <5 + build-depends: base >=4.8 && <5 + , directory-tree >=0.12 hs-source-dirs: src default-language: Haskell2010 ghc-options: -Wall