From 5b1723ab345b42c9c0bdf74993696f2c6ff6bb01 Mon Sep 17 00:00:00 2001 From: Jason Semko Date: Mon, 18 Nov 2013 17:42:55 -0800 Subject: [PATCH 1/2] 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 From eaedc962b833b1c50361135e305714d902617abb Mon Sep 17 00:00:00 2001 From: Jason Semko Date: Mon, 18 Nov 2013 17:59:58 -0800 Subject: [PATCH 2/2] updating readme --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index c55f927..0cdfd20 100644 --- a/README.md +++ b/README.md @@ -50,6 +50,7 @@ activate :deploy do |deploy| # deploy.user = "tvaughan" # no default # deploy.port = 5309 # ssh port, default: 22 # deploy.clean = true # remove orphaned files on remote host, default: false + # deploy.flags = "-rltgoDvzO --no-p --del -e" # add custom flags, default: -avze end ```