mirror of
https://github.com/Luzifer/s3sync.git
synced 2024-12-20 19:41:15 +00:00
Fix: Synced files from Windows did not have subdirs
This commit is contained in:
parent
c9bb60b6aa
commit
1e5158ffc1
2 changed files with 3 additions and 2 deletions
2
local.go
2
local.go
|
@ -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
3
s3.go
|
@ -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
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue