From a1c7dcf63fdfb3c8902e31a6616821497a163847 Mon Sep 17 00:00:00 2001 From: Timon Ringwald Date: Wed, 17 Aug 2022 20:20:51 +0200 Subject: [PATCH] fixed bug --- configfile.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/configfile.go b/configfile.go index 30f1c6b..6b0eeaa 100644 --- a/configfile.go +++ b/configfile.go @@ -28,8 +28,12 @@ func Path(fileExtension string) (string, error) { } for _, path := range paths { + if err := os.MkdirAll(filepath.Dir(path), 0744); err != nil { + continue + } + f, err := os.Create(path) - if err != nil { + if err == nil { f.Close() return path, nil }