about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorChris Kinniburgh <chris@cjkinni.com>2019-06-05 12:48:00 -0500
committerDrew DeVault <sir@cmpwn.com>2019-06-05 13:48:24 -0400
commit6c6bb4c893432fe165398364e9705bc976d0ef05 (patch)
treea8b3307acc9399a08a7dc6ab075405d2223e786e
parent0771eaf24c5a1f0e37e0a51fefe1cb5090fa7e2b (diff)
downloadaerc-6c6bb4c893432fe165398364e9705bc976d0ef05.tar.gz
config: sort account folders
directory list depends on these being sorted
-rw-r--r--config/config.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/config/config.go b/config/config.go
index 1fb764b..889a63d 100644
--- a/config/config.go
+++ b/config/config.go
@@ -9,6 +9,7 @@ import (
 	"os/exec"
 	"path"
 	"regexp"
+	"sort"
 	"strings"
 	"unicode"
 
@@ -122,7 +123,9 @@ func loadAccountConfig(path string) ([]AccountConfig, error) {
 		}
 		for key, val := range sec.KeysHash() {
 			if key == "folders" {
-				account.Folders = strings.Split(val, ",")
+				folders := strings.Split(val, ",")
+				sort.Strings(folders)
+				account.Folders = folders
 			} else if key == "source-cred-cmd" {
 				account.SourceCredCmd = val
 			} else if key == "outgoing" {