Fix remote path calcuation when continuously mirroring fs dir to any target (#1853)
This commit is contained in:
committed by
Harshavardhana
parent
53ab0168e4
commit
d9b3f276b8
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user