aboutsummaryrefslogtreecommitdiff
path: root/vendor/supply_drop/lib
diff options
context:
space:
mode:
authorelijah <elijah@riseup.net>2013-01-13 20:26:04 -0800
committerelijah <elijah@riseup.net>2013-01-13 20:26:04 -0800
commit95225c89cef3dbe90e676905f8f3accd9ab314a1 (patch)
treea62b8c5cbaac293caed71f16e3326e359e61cb36 /vendor/supply_drop/lib
parent9b15911de0b2715a9d76a57eb865e7765af8b2e4 (diff)
downloadleap_cli-95225c89cef3dbe90e676905f8f3accd9ab314a1.tar.gz
leap_cli-95225c89cef3dbe90e676905f8f3accd9ab314a1.tar.bz2
patch supply_drop so rsync can accept --include and arbitrary flags.
Diffstat (limited to 'vendor/supply_drop/lib')
-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)