diff options
author | elijah <elijah@riseup.net> | 2013-01-13 20:26:04 -0800 |
---|---|---|
committer | elijah <elijah@riseup.net> | 2013-01-13 20:26:04 -0800 |
commit | 95225c89cef3dbe90e676905f8f3accd9ab314a1 (patch) | |
tree | a62b8c5cbaac293caed71f16e3326e359e61cb36 /vendor/supply_drop | |
parent | 9b15911de0b2715a9d76a57eb865e7765af8b2e4 (diff) |
patch supply_drop so rsync can accept --include and arbitrary flags.
Diffstat (limited to 'vendor/supply_drop')
-rw-r--r-- | vendor/supply_drop/lib/supply_drop/rsync.rb | 8 |
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) |