module Summoner.Default
( defaultGHC
, defaultTomlFile
, defaultConfigFile
, currentYear
, endLine
) where
import Data.Time (getCurrentTime, toGregorian, utctDay)
import System.Directory (getHomeDirectory)
import System.FilePath ((</>))
import Summoner.GhcVer (GhcVer)
defaultGHC :: GhcVer
defaultGHC = maxBound
defaultTomlFile :: String
defaultTomlFile = ".summoner.toml"
defaultConfigFile :: IO FilePath
defaultConfigFile = (</> defaultTomlFile) <$> getHomeDirectory
currentYear :: IO Text
currentYear = do
now <- getCurrentTime
let (year, _, _) = toGregorian $ utctDay now
pure $ show year
endLine :: Text
endLine = "\n"