lib/middleman-deploy/commands.rb in middleman-deploy-0.1.3 vs lib/middleman-deploy/commands.rb in middleman-deploy-0.1.4
- old
+ new
@@ -56,10 +56,12 @@
deploy.user = "tvaughan"
# port is optional (default is 22)
deploy.port = 5309
# clean is optional (default is false)
deploy.clean = true
+ # flags is optional (default is -avze)
+ deploy.flags = "-rltgoDvzO --no-p --del -e"
end
# To deploy to a remote branch via git (e.g. gh-pages on github):
activate :deploy do |deploy|
deploy.method = :git
@@ -137,12 +139,14 @@
dest_url = "#{user}#{host}:#{path}"
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"
end
run command
@@ -183,10 +187,11 @@
else
`git checkout -b #{branch}`
end
`git add -A`
- `git commit --allow-empty -am 'Automated commit at #{Time.now.utc} by #{Middleman::Deploy::PACKAGE} #{Middleman::Deploy::VERSION}'`
+ # '"message"' double quotes to fix windows issue
+ `git commit --allow-empty -am '"Automated commit at #{Time.now.utc} by #{Middleman::Deploy::PACKAGE} #{Middleman::Deploy::VERSION}"'`
`git push -f origin #{branch}`
end
end
def deploy_ftp