From 6bc3f2fdd4b18106b0fccd37e5df9303e054bc09 Mon Sep 17 00:00:00 2001 From: Robert Gerus Date: Sat, 12 Dec 2015 12:35:30 +0100 Subject: [PATCH] Adjust main file to changes in config. --- gorepost.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gorepost.go b/gorepost.go index 5faf31f..7b726d9 100644 --- a/gorepost.go +++ b/gorepost.go @@ -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 }