Copyright | (c) 2019-2020 Vaclav Svejcar |
---|---|
License | BSD-3 |
Maintainer | vaclav.svejcar@gmail.com |
Stability | experimental |
Portability | POSIX |
Safe Haskell | None |
Language | Haskell2010 |
Headroom.Command.Init
Description
Module representing the init
command, responsible for generating all the
required files (configuration, templates) for the given project, which are then
required by the run
or gen
commands.
Synopsis
- data Env = Env {
- envLogFunc :: !LogFunc
- envInitOptions :: !CommandInitOptions
- envPaths :: !Paths
- data Paths = Paths {
- pCurrentDir :: !FilePath
- pConfigFile :: !FilePath
- pTemplatesDir :: !FilePath
- class HasPaths env where
- class HasInitOptions env where
- initOptionsL :: Lens' env CommandInitOptions
- commandInit :: CommandInitOptions -> IO ()
- doesAppConfigExist :: (HasLogFunc env, HasPaths env) => RIO env Bool
- findSupportedFileTypes :: (HasInitOptions env, HasLogFunc env) => RIO env [FileType]
Documentation
RIO Environment for the init
command.
Constructors
Env | |
Fields
|
Instances
HasLogFunc Env Source # | |
Defined in Headroom.Command.Init | |
HasPaths Env Source # | |
HasInitOptions Env Source # | |
Defined in Headroom.Command.Init Methods initOptionsL :: Lens' Env CommandInitOptions Source # |
Paths to various locations of file system.
Constructors
Paths | |
Fields
|
class HasInitOptions env where Source #
Environment value with init
command options.
Methods
initOptionsL :: Lens' env CommandInitOptions Source #
Instances
HasInitOptions Env Source # | |
Defined in Headroom.Command.Init Methods initOptionsL :: Lens' Env CommandInitOptions Source # |
Arguments
:: CommandInitOptions |
|
-> IO () | execution result |
Handler for init
command.
doesAppConfigExist :: (HasLogFunc env, HasPaths env) => RIO env Bool Source #
Checks whether application config file already exists.
findSupportedFileTypes :: (HasInitOptions env, HasLogFunc env) => RIO env [FileType] Source #
Recursively scans provided source paths for known file types for which templates can be generated.