Handle non IsNotExist errors in config (#1251)
Co-authored-by: Asim Aslam <asim@aslam.me>
This commit is contained in:
parent
5e8d5834eb
commit
f1e7ea3020
@ -53,6 +53,8 @@ func Set(key, value string) error {
|
|||||||
// write the file if it does not exist
|
// write the file if it does not exist
|
||||||
if _, err := os.Stat(fp); os.IsNotExist(err) {
|
if _, err := os.Stat(fp); os.IsNotExist(err) {
|
||||||
ioutil.WriteFile(fp, []byte{}, 0644)
|
ioutil.WriteFile(fp, []byte{}, 0644)
|
||||||
|
} else if err != nil {
|
||||||
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
// create a new config
|
// create a new config
|
||||||
|
Loading…
Reference in New Issue
Block a user