~taiite/public-inbox

This thread contains a patchset. You're looking at the original emails, but you may wish to use the patch review UI. Review patch
1

[PATCH senpai] Use path.Join to construct config file path

Details
Message ID
<20210429100541.15367-1-yyp@disroot.org>
DKIM signature
pass
Download raw message
Patch: +4 -2
It would make it work on non-Unix systems and also handle things like
.. in the configuration option
---
 cmd/senpai/main.go | 3 ++-
 cmd/test/main.go   | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/cmd/senpai/main.go b/cmd/senpai/main.go
index 5f7933d..d428ccf 100644
--- a/cmd/senpai/main.go
+++ b/cmd/senpai/main.go
@@ -5,6 +5,7 @@ import (
	"log"
	"math/rand"
	"os"
	"path"
	"time"

	"git.sr.ht/~taiite/senpai"
@@ -29,7 +30,7 @@ func main() {
		if err != nil {
			log.Panicln(err)
		}
		configPath = configDir + "/senpai/senpai.yaml"
		configPath = path.Join(configDir, "senpai", "senpai.yaml")
	}

	cfg, err := senpai.LoadConfigFile(configPath)
diff --git a/cmd/test/main.go b/cmd/test/main.go
index 05257f8..6ed7f4e 100644
--- a/cmd/test/main.go
+++ b/cmd/test/main.go
@@ -7,6 +7,7 @@ import (
	"io"
	"net"
	"os"
	"path"

	"git.sr.ht/~taiite/senpai"
	"git.sr.ht/~taiite/senpai/irc"
@@ -110,7 +111,7 @@ func parseFlags() {
			if err != nil {
				panic(err)
			}
			configPath = configDir + "/senpai/senpai.yaml"
			configPath = path.Join(configDir, "senpai", "senpai.yaml")
		}

		cfg, err := senpai.LoadConfigFile(configPath)
-- 
2.31.1
Details
Message ID
<20210429132426.63b1d512@vroom.localdomain>
In-Reply-To
<20210429100541.15367-1-yyp@disroot.org> (view parent)
DKIM signature
pass
Download raw message
Thanks, pushed!
Reply to thread Export thread (mbox)