fixed for new ghc version

This commit is contained in:
Dennis Frieberg 2025-05-10 13:36:56 +02:00
parent 6ab55f82a6
commit f88fcc1391
Signed by: nerf
GPG key ID: 7C58AFED036072C5
4 changed files with 21 additions and 23 deletions

View file

@ -37,21 +37,20 @@ findChoirDay today table = maybe
main' :: App ()
main' = do
args <- liftIO getArgs
if length args /= 1
then
fail "We need exactly one config path as option"
else do
config <- parseConfigFile (head args)
-- we want to handle these while we have the config in scope
result <- liftIO $ runApp $ do
bs <- request
table <- except $ parseBString bs
today <- liftIO getToday
record <- except $ findChoirDay today table
send (mailDomain config) (mailUsername config) (mailPassword config) (mailTo config) (mailFrom config) (mailSubject record) (mailText record)
case result of
Right x -> return x
Left error' -> reportErrorMail config error'
case L.uncons args of
Nothing -> fail "We need exactly one config path as option"
Just (headArgs,_) -> do
config <- parseConfigFile headArgs
-- we want to handle these while we have the config in scope
result <- liftIO $ runApp $ do
bs <- request
table <- except $ parseBString bs
today <- liftIO getToday
record <- except $ findChoirDay today table
send (mailDomain config) (mailUsername config) (mailPassword config) (mailTo config) (mailFrom config) (mailSubject record) (mailText record)
case result of
Right x -> return x
Left error' -> reportErrorMail config error'

View file

@ -5,7 +5,6 @@ import Network.HTTP.Req
-- import qualified Data.Text as T
import Control.Monad.IO.Class(MonadIO)
import qualified Data.ByteString as B
import Text.URI
url :: Url 'Https
url = https "md.darmstadt.ccc.de" /: "mathechor-probenplanung" /: "download"