From 5b1723ab345b42c9c0bdf74993696f2c6ff6bb01 Mon Sep 17 00:00:00 2001 From: Jason Semko Date: Mon, 18 Nov 2013 17:42:55 -0800 Subject: [PATCH] adding a flags option to override default rsync flags --- lib/middleman-deploy/commands.rb | 4 +++- lib/middleman-deploy/extension.rb | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/middleman-deploy/commands.rb b/lib/middleman-deploy/commands.rb index 44a734a..e55dffb 100644 --- a/lib/middleman-deploy/commands.rb +++ b/lib/middleman-deploy/commands.rb @@ -139,7 +139,9 @@ EOF puts "## Deploying via rsync to #{dest_url} port=#{port}" - command = "rsync -avze '" + "ssh -p #{port}" + "' #{self.inst.build_dir}/ #{dest_url}" + flags = !self.deploy_options.flags ? '-avze' : self.deploy_options.flags + + command = "rsync " + flags + " '" + "ssh -p #{port}" + "' #{self.inst.build_dir}/ #{dest_url}" if self.deploy_options.clean command += " --delete" diff --git a/lib/middleman-deploy/extension.rb b/lib/middleman-deploy/extension.rb index 9722804..12eed41 100644 --- a/lib/middleman-deploy/extension.rb +++ b/lib/middleman-deploy/extension.rb @@ -5,7 +5,7 @@ require "middleman-core" module Middleman module Deploy - class Options < Struct.new(:whatisthis, :method, :host, :port, :user, :password, :path, :clean, :remote, :branch, :build_before); end + class Options < Struct.new(:whatisthis, :method, :host, :port, :user, :password, :path, :clean, :remote, :branch, :build_before, :flags); end class << self