Skip to content

Commit

Permalink
Workaround for Middleman deploy issue
Browse files Browse the repository at this point in the history
  • Loading branch information
jodosha committed Jan 29, 2016
1 parent 4d0509a commit 6db8d3b
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
3 changes: 2 additions & 1 deletion bin/site
Expand Up @@ -16,7 +16,8 @@ function build_site {
}

function publish_site {
_middleman deploy --build-before
_middleman deploy
git checkout build
}

function print_help {
Expand Down
2 changes: 2 additions & 0 deletions config.rb
@@ -1,5 +1,6 @@
require 'rack/utils'
require 'middleman-syntax'
require_relative "./extensions/build_cleaner"

###
# Compass
Expand Down Expand Up @@ -192,4 +193,5 @@ def hanami_version

# Or use a different image path
# set :http_prefix, "/Content/images/"
activate :build_cleaner
end
9 changes: 9 additions & 0 deletions extensions/build_cleaner.rb
@@ -0,0 +1,9 @@
#lib/build_cleaner.rb
class BuildCleaner < Middleman::Extension
def initialize(app, options_hash={}, &block)
super
FileUtils.rm_rf app.config[:build_dir]
end
end

::Middleman::Extensions.register(:build_cleaner, BuildCleaner)

0 comments on commit 6db8d3b

Please sign in to comment.