cleanup: Make peroxide use the refactored bridge API

Issue #6
create-reload-action
Lukasz Janyst 4 years ago
parent ea9689a714
commit f4c05908af
No known key found for this signature in database
GPG Key ID: 32DE641041F17A9A
  1. 11
      cmd/peroxide/main.go

@ -20,8 +20,7 @@ package main
import ( import (
"flag" "flag"
"github.com/ljanyst/peroxide/pkg/app/base" "github.com/ljanyst/peroxide/pkg/bridge"
"github.com/ljanyst/peroxide/pkg/app/bridge"
"github.com/ljanyst/peroxide/pkg/files" "github.com/ljanyst/peroxide/pkg/files"
"github.com/sirupsen/logrus" "github.com/sirupsen/logrus"
) )
@ -31,12 +30,14 @@ var config = flag.String("config", files.ExpandTilde("~/.config/protonmail/bridg
func main() { func main() {
flag.Parse() flag.Parse()
base, err := base.New(*config) b := &bridge.Bridge{}
err := b.Configure(*config)
if err != nil { if err != nil {
logrus.WithError(err).Fatal("Failed to create app base") logrus.WithError(err).Fatal("Failed to configure the bridge")
} }
if bridge.MailLoop(base); err != nil { if b.Run(); err != nil {
logrus.WithError(err).Fatal("Bridge exited with error") logrus.WithError(err).Fatal("Bridge exited with error")
} }
} }

Loading…
Cancel
Save