Error message for use of publish without publish socket path

This commit is contained in:
Amiel Martin 2021-10-13 15:36:25 -08:00
parent 064d2f0341
commit c65d978114
No known key found for this signature in database
GPG Key ID: EBD5DF39BDE06E84
1 changed files with 5 additions and 0 deletions

View File

@ -2,6 +2,7 @@ package pomo
import ( import (
"encoding/json" "encoding/json"
"fmt"
"io/ioutil" "io/ioutil"
"os" "os"
"path" "path"
@ -118,5 +119,9 @@ func LoadConfig(configPath string, config *Config) error {
if config.IconPath == "" { if config.IconPath == "" {
config.IconPath = path.Join(config.BasePath, "/icon.png") 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 return nil
} }