Skip to content

Commit

Permalink
feat: create directory in buildDirName function if it doesn't
Browse files Browse the repository at this point in the history
  • Loading branch information
pluveto committed Nov 16, 2024
1 parent d2e4950 commit c40f2bb
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion cmd/flydav/app/webdav.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,11 @@ func buildDirName(fsDir, subFsDir string) webdav.Dir {
if subFsDir == "" {
return webdav.Dir(fsDir)
}
return webdav.Dir(filepath.Join(fsDir, subFsDir))
dir := filepath.Join(fsDir, subFsDir)
if _, err := os.Stat(dir); os.IsNotExist(err) {
os.MkdirAll(dir, 0755)
}
return webdav.Dir(dir)
}

func buildPathPrefix(path, userPrefix string) string {
Expand Down

0 comments on commit c40f2bb

Please sign in to comment.