Skip to content

Commit

Permalink
chore: check if the pebble binary exists and error if not
Browse files Browse the repository at this point in the history
  • Loading branch information
kayra1 committed Sep 24, 2024
1 parent 951d309 commit e1fd473
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions internal/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package config
import (
"errors"
"os"
"os/exec"

"gopkg.in/yaml.v3"
)
Expand Down Expand Up @@ -63,6 +64,12 @@ func Validate(filePath string) (Config, error) {
if c.Port == 0 {
return config, errors.Join(validationErr, errors.New("`port` is empty"))
}
if c.Pebblenotificationsenabled {
_, err := exec.LookPath("pebble")
if err != nil {
return config, errors.Join(validationErr, errors.New("pebble binary not found"))
}
}

config.Cert = cert
config.Key = key
Expand Down

0 comments on commit e1fd473

Please sign in to comment.