fix: dir not exist

This commit is contained in:
Simon Ding
2024-08-12 23:06:51 +08:00
parent 4800e6c79d
commit cc211a89a4

View File

@@ -99,5 +99,6 @@ 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)
}