Add config file, handle it with Viper, add a command to open it in an editor

This commit is contained in:
Ken-Håvard Lieng 2015-05-25 04:00:21 +02:00
parent b8a8ba2e08
commit 61aa5880d3
234 changed files with 44636 additions and 383 deletions

View file

@ -304,7 +304,7 @@ func (u *User) SearchMessages(server, channel, phrase string) ([]Message, error)
func (u *User) openMessageLog() {
var err error
u.messageLog, err = bolt.Open(path.Join(appDir, "logs", u.UUID+"_log"), 0600, nil)
u.messageLog, err = bolt.Open(path.Join(AppDir, "logs", u.UUID+"_log"), 0600, nil)
if err != nil {
log.Fatal(err)
}
@ -315,7 +315,7 @@ func (u *User) openMessageLog() {
return nil
})
indexPath := path.Join(appDir, "logs", u.UUID+"_index")
indexPath := path.Join(AppDir, "logs", u.UUID+"_index")
u.messageIndex, err = bleve.Open(indexPath)
if err == bleve.ErrorIndexPathDoesNotExist {
mapping := bleve.NewIndexMapping()