Fix remote path calcuation when continuously mirroring fs dir to any target (#1853)

This commit is contained in:
Anis Elleuch
2016-10-10 13:03:40 -07:00
committed by Harshavardhana
parent 53ab0168e4
commit d9b3f276b8
+10
View File
@@ -397,6 +397,16 @@ func (ms *mirrorSession) watch() {
// again, by replacing the sourceUrlFull with the sourceAlias. This url will be
// used to mirror.
sourceAlias, sourceURLFull, _ := mustExpandAlias(ms.sourceURL)
// If the passed source URL points to fs, fetch the absolute src path
// to correctly calculate targetPath
if sourceAlias == "" {
tmpSrcUrl, err := filepath.Abs(sourceURLFull)
if err == nil {
sourceURLFull = tmpSrcUrl
}
}
sourceURL := newClientURL(event.Path)
aliasedPath := strings.Replace(event.Path, sourceURLFull, ms.sourceURL, -1)