call deploy via middleman's built-in after_build hook
TODO: pass "--clean" or "--no-clean" to deploy as passed to build
This commit is contained in:
parent
aa59736914
commit
2b33d3d409
1 changed files with 7 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue