internal: dont error if environment config isn't found
Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
parent
5ae593bc00
commit
b6b72e389d
|
@ -1,6 +1,7 @@
|
|||
package config
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"net/url"
|
||||
"os"
|
||||
|
@ -62,6 +63,9 @@ func (c *Config) Setup(paths ...string) {
|
|||
func (c *Config) LoadConfig(path string) error {
|
||||
raw, err := os.ReadFile(path)
|
||||
if err != nil {
|
||||
if errors.Is(err, os.ErrNotExist) {
|
||||
return nil
|
||||
}
|
||||
return fmt.Errorf("failed to load config file: %w", err)
|
||||
}
|
||||
err = yaml.Unmarshal(raw, c)
|
||||
|
|
Reference in New Issue