Sha256: 06e130fe958f830f04e20d5e9f48158e13e8110e871e6b09345d2303ac5ecf2e
Contents?: true
Size: 528 Bytes
Versions: 9
Compression:
Stored size: 528 Bytes
Contents
class KuberKit::Shell::RsyncCommands def rsync(shell, source_path, target_path, exclude: nil) # Add a trailing slash to directory to have behavior similar to CP command if path_is_directory?(source_path) && !source_path.end_with?("/") source_path = "#{source_path}/" end args = [source_path, target_path] if exclude args << "--exclude=#{exclude}" end shell.exec!(%Q{rsync -a #{args.join(' ')}}) end private def path_is_directory?(path) File.directory?(path) end end
Version data entries
9 entries across 9 versions & 1 rubygems