summaryrefslogtreecommitdiff
path: root/config.go
diff options
context:
space:
mode:
authorAlex McGrath <amk@amk.ie>2021-11-24 13:52:21 +0000
committerHubert Hirtz <hubert@hirtz.pm>2021-11-24 15:04:36 +0100
commitbbb92bbfa026bdd0bab7ea64230a07aa70f98ba2 (patch)
treea7e824bea6b48ab937b2373777bd5c4a564eda28 /config.go
parentTidy things (diff)
Only use first line of `password-cmd` output
Diffstat (limited to 'config.go')
-rw-r--r--config.go6
1 files changed, 4 insertions, 2 deletions
diff --git a/config.go b/config.go
index 79c710e..d232cf4 100644
--- a/config.go
+++ b/config.go
@@ -178,8 +178,10 @@ func unmarshal(filename string, cfg *Config) (err error) {
return fmt.Errorf("error running password command: %s", err)
}
- password := strings.TrimSuffix(string(stdout), "\n")
- cfg.Password = &password
+ passCmdOut := strings.Split(string(stdout), "\n")
+ if len(passCmdOut) >= 1 {
+ cfg.Password = &passCmdOut[0]
+ }
case "channel":
// TODO: does this work with soju.im/bouncer-networks extension?
cfg.Channels = append(cfg.Channels, d.Params...)