From 92e7724a1aa7d057a01f2203ea88e3526e11ad46 Mon Sep 17 00:00:00 2001 From: John Manoogian III Date: Mon, 6 May 2013 16:39:19 -0700 Subject: [PATCH] (optionally) force a build before any deploy --- lib/middleman-deploy/commands.rb | 1 + lib/middleman-deploy/extension.rb | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/middleman-deploy/commands.rb b/lib/middleman-deploy/commands.rb index 5acf3dd..6ef5841 100644 --- a/lib/middleman-deploy/commands.rb +++ b/lib/middleman-deploy/commands.rb @@ -28,6 +28,7 @@ module Middleman :aliases => "-c", :desc => "Remove orphaned files or directories on the remote host" def deploy + Middleman::Cli::Build.new.build if self.deploy_options.force_build send("deploy_#{self.deploy_options.method}") end diff --git a/lib/middleman-deploy/extension.rb b/lib/middleman-deploy/extension.rb index 53613bd..8a049a7 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, :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 @@ -23,6 +23,7 @@ module Middleman options.branch ||= "gh-pages" options.after_build ||= false + options.force_build ||= false app.after_build do |builder| ::Middleman::Cli::Deploy.new.deploy if options.after_build