mirror of
https://git.nerfingen.de/nerf/choirMail.git
synced 2025-05-12 00:40:31 +00:00
fixed for new ghc version
This commit is contained in:
parent
6ab55f82a6
commit
f88fcc1391
4 changed files with 21 additions and 23 deletions
29
app/Main.hs
29
app/Main.hs
|
@ -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'
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -76,7 +76,7 @@ executable choirMail
|
|||
|
||||
-- Other library packages from which modules are imported.
|
||||
-- ^>=4.15.1.0
|
||||
build-depends: base >=4.15.1.0 && < 4.19
|
||||
build-depends: base >=4.15.1.0 && < 4.21
|
||||
,transformers
|
||||
,tomland >= 1.3.3.0
|
||||
,smtp-mail
|
||||
|
|
12
flake.lock
generated
12
flake.lock
generated
|
@ -5,11 +5,11 @@
|
|||
"systems": "systems"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1710146030,
|
||||
"narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=",
|
||||
"lastModified": 1731533236,
|
||||
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a",
|
||||
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -20,11 +20,11 @@
|
|||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1712192574,
|
||||
"narHash": "sha256-LbbVOliJKTF4Zl2b9salumvdMXuQBr2kuKP5+ZwbYq4=",
|
||||
"lastModified": 1746576598,
|
||||
"narHash": "sha256-FshoQvr6Aor5SnORVvh/ZdJ1Sa2U4ZrIMwKBX5k2wu0=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "f480f9d09e4b4cf87ee6151eba068197125714de",
|
||||
"rev": "b3582c75c7f21ce0b429898980eddbbf05c68e55",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue