signaldctl: create config directory if missing

This commit is contained in:
finn 2022-03-28 09:42:37 -07:00
parent d8fdb8edb0
commit 0ff6400ce7

View file

@ -18,6 +18,7 @@ package config
import (
"log"
"os"
"path"
"gopkg.in/yaml.v2"
)
@ -54,6 +55,9 @@ func Load() error {
}
func Save() error {
if err := os.MkdirAll(path.Dir(Path), 0660); err != nil {
return err
}
f, err := os.Create(Path)
if err != nil {
return err