From c65d97811486fc7e017bccc7da196bc32ee38eb4 Mon Sep 17 00:00:00 2001 From: Amiel Martin Date: Wed, 13 Oct 2021 15:36:25 -0800 Subject: [PATCH] Error message for use of publish without publish socket path --- pkg/internal/config.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkg/internal/config.go b/pkg/internal/config.go index d76fe4b..0df5cfb 100644 --- a/pkg/internal/config.go +++ b/pkg/internal/config.go @@ -2,6 +2,7 @@ package pomo import ( "encoding/json" + "fmt" "io/ioutil" "os" "path" @@ -118,5 +119,9 @@ func LoadConfig(configPath string, config *Config) error { if config.IconPath == "" { config.IconPath = path.Join(config.BasePath, "/icon.png") } + if config.Publish && (config.PublishSocketPath == "" || config.PublishSocketPath == config.SocketPath) { + return fmt.Errorf("'publish' option now requires 'publishSocketPath' which must not be the same as 'socketPath'") + } + return nil }