less convoluted

This commit is contained in:
Tom Vaughan 2012-08-22 12:37:37 -07:00
parent 3ba51e320f
commit c4290d9d29
2 changed files with 6 additions and 7 deletions

View file

@ -19,11 +19,11 @@ module Middleman
desc "deploy", "Deploy to a remote host over rsync" desc "deploy", "Deploy to a remote host over rsync"
def deploy def deploy
shared_instance = ::Middleman::Application.server.inst options = ::Middleman::Application.server.inst.options
# This only exists when the config.rb sets it! # These only exists when the config.rb sets them!
if shared_instance.respond_to? :deploy if (options.host && options.user && options.path)
shared_instance.deploy(self) run "rsync -avze '" + "ssh -p #{options.port}" + "' #{"--delete" if options.delete == true} build/ #{options.user}@#{options.host}:#{options.path}"
else else
raise Thor::Error.new "You need to activate the deploy extension in config.rb " raise Thor::Error.new "You need to activate the deploy extension in config.rb "
end end

View file

@ -43,9 +43,8 @@ EOF
end end
module Helpers module Helpers
def deploy(builder) def options
options = ::Middleman::Deploy.options ::Middleman::Deploy.options
builder.run "rsync -avze '" + "ssh -p #{options.port}" + "' #{"--delete" if options.delete == true} build/ #{options.user}@#{options.host}:#{options.path}"
end end
end end