Author: Amiel Martin [amiel.martin@gmail.com]
Hash: c65d97811486fc7e017bccc7da196bc32ee38eb4
Timestamp: Wed, 13 Oct 2021 23:36:25 +0000 (3 years ago)

+5 -0 +/-1 browse
Error message for use of publish without publish socket path
1diff --git a/pkg/internal/config.go b/pkg/internal/config.go
2index d76fe4b..0df5cfb 100644
3--- a/pkg/internal/config.go
4+++ b/pkg/internal/config.go
5 @@ -2,6 +2,7 @@ package pomo
6
7 import (
8 "encoding/json"
9+ "fmt"
10 "io/ioutil"
11 "os"
12 "path"
13 @@ -118,5 +119,9 @@ func LoadConfig(configPath string, config *Config) error {
14 if config.IconPath == "" {
15 config.IconPath = path.Join(config.BasePath, "/icon.png")
16 }
17+ if config.Publish && (config.PublishSocketPath == "" || config.PublishSocketPath == config.SocketPath) {
18+ return fmt.Errorf("'publish' option now requires 'publishSocketPath' which must not be the same as 'socketPath'")
19+ }
20+
21 return nil
22 }