Merge pull request #24 from jm3/force-build
(optionally) force a build before any deploy
This commit is contained in:
commit
264f1082b2
2 changed files with 3 additions and 1 deletions
|
@ -28,6 +28,7 @@ module Middleman
|
||||||
:aliases => "-c",
|
:aliases => "-c",
|
||||||
:desc => "Remove orphaned files or directories on the remote host"
|
:desc => "Remove orphaned files or directories on the remote host"
|
||||||
def deploy
|
def deploy
|
||||||
|
Middleman::Cli::Build.new.build if self.deploy_options.force_build
|
||||||
send("deploy_#{self.deploy_options.method}")
|
send("deploy_#{self.deploy_options.method}")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@ require "middleman-core"
|
||||||
module Middleman
|
module Middleman
|
||||||
module Deploy
|
module Deploy
|
||||||
|
|
||||||
class Options < Struct.new(:whatisthis, :method, :host, :port, :user, :password, :path, :clean, :remote, :branch, :after_build); end
|
class Options < Struct.new(:whatisthis, :method, :host, :port, :user, :password, :path, :clean, :remote, :branch, :after_build, :force_build); end
|
||||||
|
|
||||||
class << self
|
class << self
|
||||||
|
|
||||||
|
@ -23,6 +23,7 @@ module Middleman
|
||||||
options.branch ||= "gh-pages"
|
options.branch ||= "gh-pages"
|
||||||
|
|
||||||
options.after_build ||= false
|
options.after_build ||= false
|
||||||
|
options.force_build ||= false
|
||||||
|
|
||||||
app.after_build do |builder|
|
app.after_build do |builder|
|
||||||
::Middleman::Cli::Deploy.new.deploy if options.after_build
|
::Middleman::Cli::Deploy.new.deploy if options.after_build
|
||||||
|
|
Loading…
Reference in a new issue