module Development.Shake.Plus.Config (
readConfigFile
, readConfigFileWithEnv
, usingConfigFile
, usingConfig
, getConfig
, getConfigKeys
) where
import Development.Shake
import qualified Development.Shake.Config
import Development.Shake.Plus.Core
import Path
import RIO
readConfigFile :: MonadIO m => Path a File -> m (HashMap String String)
readConfigFile = liftIO . Development.Shake.Config.readConfigFile . toFilePath
readConfigFileWithEnv :: MonadIO m => [(String, String)] -> Path a File -> m (HashMap String String)
readConfigFileWithEnv vars file = liftIO $ Development.Shake.Config.readConfigFileWithEnv vars (toFilePath file)
usingConfigFile :: MonadRules m => Path a File -> m ()
usingConfigFile = liftRules . Development.Shake.Config.usingConfigFile . toFilePath
usingConfig :: MonadRules m => HashMap String String -> m ()
usingConfig = liftRules . Development.Shake.Config.usingConfig
getConfig :: MonadAction m => String -> m (Maybe String)
getConfig = liftAction . Development.Shake.Config.getConfig
getConfigKeys :: MonadAction m => m [String]
getConfigKeys = liftAction Development.Shake.Config.getConfigKeys