less convoluted

master
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"
def deploy
shared_instance = ::Middleman::Application.server.inst
options = ::Middleman::Application.server.inst.options
# This only exists when the config.rb sets it!
if shared_instance.respond_to? :deploy
shared_instance.deploy(self)
# These only exists when the config.rb sets them!
if (options.host && options.user && options.path)
run "rsync -avze '" + "ssh -p #{options.port}" + "' #{"--delete" if options.delete == true} build/ #{options.user}@#{options.host}:#{options.path}"
else
raise Thor::Error.new "You need to activate the deploy extension in config.rb "
end

View File

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