SKAT engine
Safe HaskellNone

Writer

Description

Persist template. Note: If there are many templates the operation is not atomic.

Synopsis

Documentation

newtype WriterError #

WriterError represents all the possible error states in the Write module

Constructors

FailedToWrite String

The process failed to write for some reason. More information should be found in the string.

Instances

Instances details
Show WriterError # 
Instance details

Defined in Writer

Methods

showsPrec :: Int -> WriterError -> ShowS

show :: WriterError -> String

showList :: [WriterError] -> ShowS

mkOutputDir :: AbsDir -> Map String RelDir -> String -> AbsDir #

getNameWithExt :: Bool -> Maybe Char -> Template -> RelFile #

getFileHandler :: AbsDir -> RelFile -> IO Handle #

persistWithContent :: String -> Handle -> IO () #

combineWhenModule :: Bool -> Template -> AbsDir -> AbsDir #

write #

Arguments

:: AbsDir

Current working directory

-> Bool

Whether to write the file as a module. If true, it will create a directory and save the templates in it.

-> GenConfig

Config

-> Template

Template to write to the output directory

-> IO (Either WriterError String) 

Write template file to output directory.

writeDotfile #

Arguments

:: AbsDir

Current working directory

-> ByteString

Dotfile contents as JSON string

-> IO (Either WriterError String) 

Write dotfile in current directory