diff --git a/lib/middleman-deploy/extension.rb b/lib/middleman-deploy/extension.rb index 53950a0..00d41f7 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, :path, :clean, :remote, :branch); end + class Options < Struct.new(:whatisthis, :method, :host, :port, :user, :path, :clean, :remote, :branch, :after_build); end class << self @@ -22,6 +22,12 @@ module Middleman options.remote ||= "origin" options.branch ||= "gh-pages" + options.after_build ||= false + + app.after_build do |builder| + ::Middleman::Cli::Deploy.new.deploy if options.after_build + end + @@options = options app.send :include, Helpers