Method: Synqa::SyncOperation#doCopyOperations

Defined in:
lib/synqa.rb

#doCopyOperations(sourceContent, destinationContent, dryRun) ⇒ Object

Recursively perform all marked copy operations from the source content tree to the destination content tree, or if dryRun, just pretend to perform them.



1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
# File 'lib/synqa.rb', line 1010

def doCopyOperations(sourceContent, destinationContent, dryRun)
  for dir in sourceContent.dirs
    if dir.copyDestination != nil
      sourcePath = sourceLocation.getFullPath(dir.relativePath)
      destinationPath = destinationLocation.getFullPath(dir.copyDestination.relativePath)
      destinationLocation.contentHost.copyLocalToRemoteDirectory(sourcePath, destinationPath, dryRun)
    else
      doCopyOperations(dir, destinationContent.getDir(dir.name), dryRun)
    end
  end
  for file in sourceContent.files
    if file.copyDestination != nil
      sourcePath = sourceLocation.getFullPath(file.relativePath)
      destinationPath = destinationLocation.getFullPath(file.copyDestination.relativePath)
      destinationLocation.contentHost.copyLocalFileToRemoteDirectory(sourcePath, destinationPath, dryRun)
    end
  end
end