~delthas/senpai-dev

Bail early if password-cmd returns no data v1 APPLIED

Hugo Osvaldo Barrera: 1
 Bail early if password-cmd returns no data

 1 files changed, 3 insertions(+), 2 deletions(-)
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~delthas/senpai-dev/patches/46088/mbox | git am -3
Learn more about email & git

[PATCH] Bail early if password-cmd returns no data Export this patch

---
 config.go | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/config.go b/config.go
index d9bfe33..f35da54 100644
--- a/config.go
+++ b/config.go
@@ -218,9 +218,10 @@ func unmarshal(filename string, cfg *Config) (err error) {
			}

			passCmdOut := strings.Split(string(stdout), "\n")
			if len(passCmdOut) >= 1 {
				cfg.Password = &passCmdOut[0]
			if len(passCmdOut) < 1 || strings.TrimSpace(passCmdOut[0]) == "" {
				return fmt.Errorf("password command returned no data")
			}
			cfg.Password = &passCmdOut[0]
		case "channel":
			// TODO: does this work with soju.im/bouncer-networks extension?
			cfg.Channels = append(cfg.Channels, d.Params...)
-- 
2.42.0
Hi,

Thanks for your patch.

Applied and pushed. :-)

To git.sr.ht:~taiite/senpai
    1a2bb12..1a5a19c  master -> master