signaldctl: create config directory if missing
This commit is contained in:
parent
d8fdb8edb0
commit
0ff6400ce7
1 changed files with 4 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue