Skip to content

Commit

Permalink
Work around middleman deploy issue #114
Browse files Browse the repository at this point in the history
Borrowing a hotfix extension from this discussion:
karlfreeman/middleman-deploy#114

The problem: for somereason mm-deploy starts deploying the source files
to gh-pages isntead of the built output. This extension forcibly removes
the build dir every time, which seems to solve the problem.
  • Loading branch information
egardner committed Jan 25, 2016
1 parent 9263598 commit d956942
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
3 changes: 3 additions & 0 deletions config.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
require_relative "./extensions/build_cleaner"

activate :directory_indexes
activate :autoprefixer

Expand All @@ -18,6 +20,7 @@

configure :build do
activate :relative_assets
activate :build_cleaner
end

activate :deploy do |deploy|
Expand Down
12 changes: 12 additions & 0 deletions extensions/build_cleaner.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#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 d956942

Please sign in to comment.