summary refs log tree commit diff stats
path: root/aerc.go
diff options
context:
space:
mode:
authorReto Brunner <reto@labrat.space>2019-05-16 14:26:08 -0700
committerDrew DeVault <sir@cmpwn.com>2019-05-16 17:26:35 -0400
commitb275a394e2e1d7836fae7519f3f13d3eacc151f5 (patch)
tree1a4760f7eb7d98f5625f1bd594d7379ecd53d411 /aerc.go
parentfb3826cee5a4c23cc1135523e267fc3801e8533a (diff)
downloadaerc-b275a394e2e1d7836fae7519f3f13d3eacc151f5.tar.gz
Abort if accounts.conf is world readable
Fixes #32
Diffstat (limited to 'aerc.go')
-rw-r--r--aerc.go8
1 files changed, 5 insertions, 3 deletions
diff --git a/aerc.go b/aerc.go
index f3607bb..3566895 100644
--- a/aerc.go
+++ b/aerc.go
@@ -1,6 +1,7 @@
 package main
 
 import (
+	"fmt"
 	"io"
 	"io/ioutil"
 	"log"
@@ -9,12 +10,12 @@ import (
 
 	"github.com/mattn/go-isatty"
 
-	"git.sr.ht/~sircmpwn/aerc2/config"
 	"git.sr.ht/~sircmpwn/aerc2/commands"
 	"git.sr.ht/~sircmpwn/aerc2/commands/account"
 	"git.sr.ht/~sircmpwn/aerc2/commands/compose"
 	"git.sr.ht/~sircmpwn/aerc2/commands/msgview"
 	"git.sr.ht/~sircmpwn/aerc2/commands/terminal"
+	"git.sr.ht/~sircmpwn/aerc2/config"
 	libui "git.sr.ht/~sircmpwn/aerc2/lib/ui"
 	"git.sr.ht/~sircmpwn/aerc2/widgets"
 )
@@ -61,7 +62,8 @@ func main() {
 
 	conf, err := config.LoadConfig(nil)
 	if err != nil {
-		panic(err)
+		fmt.Printf("Failed to load config: %v\n", err)
+		os.Exit(1)
 	}
 
 	var (
@@ -73,7 +75,7 @@ func main() {
 		for i, set := range cmds {
 			err := set.ExecuteCommand(aerc, cmd)
 			if _, ok := err.(commands.NoSuchCommand); ok {
-				if i == len(cmds) - 1 {
+				if i == len(cmds)-1 {
 					return err
 				} else {
 					continue