1
0
Fork 0
mirror of https://github.com/Luzifer/s3sync.git synced 2024-10-18 06:24:20 +00:00

Fix: Synced files from Windows did not have subdirs

This commit is contained in:
Knut Ahlers 2016-02-29 23:36:56 +01:00
parent c9bb60b6aa
commit 1e5158ffc1
2 changed files with 3 additions and 2 deletions

View file

@ -48,7 +48,7 @@ func (l *localProvider) ListFiles(prefix string) ([]file, error) {
} }
out = append(out, file{ out = append(out, file{
Filename: strings.TrimLeft(strings.Replace(path, prefix, "", 1), "/"), Filename: strings.TrimLeft(strings.Replace(path, prefix, "", 1), string(os.PathSeparator)),
Size: f.Size(), Size: f.Size(),
MD5: fmt.Sprintf("%x", md5.Sum(content)), MD5: fmt.Sprintf("%x", md5.Sum(content)),
}) })

3
s3.go
View file

@ -4,6 +4,7 @@ import (
"fmt" "fmt"
"io" "io"
"mime" "mime"
"os"
"path/filepath" "path/filepath"
"regexp" "regexp"
"strings" "strings"
@ -32,7 +33,7 @@ func (s *s3Provider) getBucketPath(prefix string) (bucket string, path string, e
} }
bucket = matches[1] bucket = matches[1]
path = matches[2] path = strings.Replace(matches[2], string(os.PathSeparator), "/", -1)
return return
} }