small semantics tweaks in synchronizer framework (#438)

This commit is contained in:
Michael Quigley 2024-01-10 13:55:07 -05:00
parent 16ddb0a1f5
commit b65d785881
No known key found for this signature in database
GPG Key ID: 9B60314A9DD20A62
2 changed files with 3 additions and 2 deletions

View File

@ -36,7 +36,6 @@ func Synchronize(src, dst Target) error {
} }
for _, copyPath := range copyList { for _, copyPath := range copyList {
logrus.Infof("copyPath: '%v' (%t)", copyPath.Path, copyPath.IsDir)
if copyPath.IsDir { if copyPath.IsDir {
if err := dst.Mkdir(copyPath.Path); err != nil { if err := dst.Mkdir(copyPath.Path); err != nil {
return err return err

View File

@ -55,8 +55,10 @@ func (t *ZrokTarget) Inventory() ([]*Object, error) {
} }
if !rootFi.IsDir { if !rootFi.IsDir {
base := filepath.Base(t.cfg.URL.Path)
t.cfg.URL.Path = filepath.Dir(t.cfg.URL.Path)
return []*Object{{ return []*Object{{
Path: t.cfg.URL.Path, Path: "/" + base,
IsDir: false, IsDir: false,
Size: rootFi.Size, Size: rootFi.Size,
Modified: rootFi.ModTime, Modified: rootFi.ModTime,