Adjust main file to changes in config.

master
Robert Gerus 2015-12-12 12:35:30 +01:00
parent be84e9ddcc
commit 6bc3f2fdd4
1 changed files with 3 additions and 3 deletions

View File

@ -11,7 +11,7 @@ import (
"path"
"github.com/arachnist/gorepost/bot"
cfg "github.com/arachnist/gorepost/config"
"github.com/arachnist/gorepost/config"
"github.com/arachnist/gorepost/irc"
)
@ -50,7 +50,7 @@ func main() {
log.Fatalln("Not a directory:", os.Args[1])
}
cfg.SetFileListBuilder(fileListFuncBuilder(os.Args[1], "common.json"))
cfg := config.New(fileListFuncBuilder(os.Args[1], "common.json"))
logfile, err := os.OpenFile(cfg.LookupString(context, "Logpath"), os.O_RDWR|os.O_CREATE|os.O_APPEND, 0644)
if err != nil {
@ -65,7 +65,7 @@ func main() {
for i, conn := range make([]irc.Connection, len(networks)) {
conn := conn
log.Println("Setting up", networks[i], "connection")
conn.Setup(bot.Dispatcher, networks[i])
conn.Setup(bot.Dispatcher, networks[i], cfg)
}
<-exit
}