Skip to content

Commit

Permalink
fix: the recursive subdirectory moving bug (#4171)
Browse files Browse the repository at this point in the history
  • Loading branch information
varg1714 authored Apr 16, 2023
1 parent 5cba104 commit 220fd30
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions server/handles/fsmanage.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,11 +150,12 @@ func FsRecursiveMove(c *gin.Context) {
for !movingFiles.IsEmpty() {

movingFile := movingFiles.Pop()
movingFilePath := fmt.Sprintf("%s/%s", filePathMap[movingFile], movingFile.GetName())
movingFilePath := filePathMap[movingFile]
movingFileName := fmt.Sprintf("%s/%s", movingFilePath, movingFile.GetName())
if movingFile.IsDir() {
// directory, recursive move
subFilePath := movingFilePath
subFiles, err := fs.List(c, subFilePath, &fs.ListArgs{Refresh: true})
subFilePath := movingFileName
subFiles, err := fs.List(c, movingFileName, &fs.ListArgs{Refresh: true})
if err != nil {
common.ErrorResp(c, err, 500)
return
Expand All @@ -171,7 +172,7 @@ func FsRecursiveMove(c *gin.Context) {
}

// move
err := fs.Move(c, movingFilePath, dstDir, movingFiles.IsEmpty())
err := fs.Move(c, movingFileName, dstDir, movingFiles.IsEmpty())
if err != nil {
common.ErrorResp(c, err, 500)
return
Expand Down

0 comments on commit 220fd30

Please sign in to comment.