summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCarlos Alexandro Becker <caarlos0@users.noreply.github.com>2024-07-10 10:35:52 -0300
committerCarlos Alexandro Becker <caarlos0@users.noreply.github.com>2024-07-10 10:35:52 -0300
commite4cacf7319340b95d6d7d9059218c32251bf9b11 (patch)
tree55887f032c9ea8e17a168a56c9972ff39fe3526b
parentad01f380bd85a9aee962050f83e22c1ad8069145 (diff)
fix: mkdir cache dir
-rw-r--r--log.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/log.go b/log.go
index f5e2bc1..0221ef9 100644
--- a/log.go
+++ b/log.go
@@ -22,6 +22,9 @@ func setupLog() (func() error, error) {
if err != nil {
return nil, err
}
+ if err := os.MkdirAll(filepath.Dir(logFile), 0o644); err != nil {
+ return nil, err
+ }
f, err := os.OpenFile(logFile, os.O_WRONLY|os.O_CREATE|os.O_APPEND, 0o644)
if err != nil {
return nil, err