Copyright | (c) 2017-2019 Kowainik |
---|---|
License | MPL-2.0 |
Maintainer | Kowainik <xrom.xkov@gmail.com> |
Safe Haskell | None |
Language | Haskell2010 |
Data type for representing filesystem structure via tree.
Documentation
Describes simple structure of filesystem tree.
Dir FilePath [TreeFs] | Name of directory (relative) and its containing entries |
File FilePath Text | File name (relative) and file content |
Instances
Eq TreeFs Source # | |
Ord TreeFs Source # | |
Show TreeFs Source # | |
Generic TreeFs Source # | |
type Rep TreeFs Source # | |
Defined in Summoner.Tree type Rep TreeFs = D1 ('MetaData "TreeFs" "Summoner.Tree" "summoner-2.0.0.0-inplace" 'False) (C1 ('MetaCons "Dir" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 FilePath) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [TreeFs])) :+: C1 ('MetaCons "File" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 FilePath) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text))) |
traverseTree :: TreeFs -> IO () Source #
Walks through directory tree and write file contents, creating all intermediate directories.
pathToTree :: FilePath -> Text -> TreeFs Source #
This function converts a string file path to the tree structure.
For a path like this: ".githubworkflowci.yml"
This function produces the following tree:
.github/ └── workflow/ └── ci.yml
showBoldTree :: TreeFs -> Text Source #
Pretty shows the directory tree content.