Skip to content

Commit

Permalink
Fix push dir failed when withSrcDir is false (#21)
Browse files Browse the repository at this point in the history
  • Loading branch information
prife committed Sep 10, 2024
1 parent ed28e82 commit ef22ffd
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -317,17 +317,16 @@ func MakeDirs(c *Device, local string, remote string, withSrcDir bool) (err erro
if err != nil {
return
}
var remoteSubDirs []string
remoteSubDirs := make([]string, 1+len(subdirs))
if baseName != "" {
remoteSubDirs = make([]string, 1+len(subdirs))
remoteSubDirs[0] = remote + "/" + baseName
for i, d := range subdirs {
remoteSubDirs[i+1] = remote + "/" + baseName + "/" + d
}
} else {
remoteSubDirs = make([]string, len(subdirs))
remoteSubDirs[0] = remote
for i, d := range subdirs {
remoteSubDirs[i] = remote + "/" + d
remoteSubDirs[i+1] = remote + "/" + d
}
}
err = c.MkdirsWithParent(remoteSubDirs, true)
Expand Down

0 comments on commit ef22ffd

Please sign in to comment.