Skip to content

Commit

Permalink
fix: mkdir
Browse files Browse the repository at this point in the history
  • Loading branch information
simon-ding committed Aug 12, 2024
1 parent cc211a8 commit 02a23f1
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pkg/storage/local.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ func (l *LocalStorage) ReadFile(name string) ([]byte, error) {
}

func (l *LocalStorage) WriteFile(name string, data []byte) error {
os.MkdirAll(filepath.Dir(name), os.ModePerm)
return os.WriteFile(filepath.Join(l.dir, name), data, os.ModePerm)
path := filepath.Join(l.dir, name)
os.MkdirAll(filepath.Dir(path), os.ModePerm)
return os.WriteFile(path, data, os.ModePerm)
}

0 comments on commit 02a23f1

Please sign in to comment.