summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--vendor/supply_drop/lib/supply_drop/rsync.rb8
1 files changed, 7 insertions, 1 deletions
diff --git a/vendor/supply_drop/lib/supply_drop/rsync.rb b/vendor/supply_drop/lib/supply_drop/rsync.rb
index 6d561ea..732a719 100644
--- a/vendor/supply_drop/lib/supply_drop/rsync.rb
+++ b/vendor/supply_drop/lib/supply_drop/rsync.rb
@@ -4,8 +4,10 @@ module SupplyDrop
def command(from, to, options={})
flags = ['-az']
flags << '--delete' if options[:delete]
+ flags << includes(options[:includes]) if options.has_key?(:includes)
flags << excludes(options[:excludes]) if options.has_key?(:excludes)
flags << ssh_options(options[:ssh]) if options.has_key?(:ssh)
+ flags << options[:flags] if options.has_key?(:flags)
"rsync #{flags.compact.join(' ')} #{from} #{to}"
end
@@ -16,7 +18,11 @@ module SupplyDrop
end
def excludes(patterns)
- [patterns].flatten.map { |p| "--exclude=#{p}" }
+ [patterns].flatten.map { |p| "--exclude='#{p}'" }
+ end
+
+ def includes(patterns)
+ [patterns].flatten.map { |p| "--include='#{p}'" }
end
def ssh_options(options)