diff --git a/bin/mm-build b/bin/mm-build index ac012a46..7fe8bcca 100755 --- a/bin/mm-build +++ b/bin/mm-build @@ -4,7 +4,9 @@ ENV['MM_ENV'] = "build" # Require app require File.join(File.dirname(__FILE__), "..", "lib", "middleman") -Middleman::Base.init! - require 'middleman/builder' + +Middleman::Base.init! +Middleman::Builder.init! + Middleman::Generators.run_cli(Dir.pwd, 'mm-build', 1, %w(build --force).concat(ARGV)) \ No newline at end of file diff --git a/lib/middleman/builder.rb b/lib/middleman/builder.rb index 02092ff8..a2fcf5db 100644 --- a/lib/middleman/builder.rb +++ b/lib/middleman/builder.rb @@ -36,8 +36,10 @@ module Middleman super(name, *args, &block) end - glob! File.basename(Middleman::Base.public), Middleman::Base.supported_formats - glob! File.basename(Middleman::Base.views), Middleman::Base.supported_formats + def self.init! + glob! File.basename(Middleman::Base.public), Middleman::Base.supported_formats + glob! File.basename(Middleman::Base.views), Middleman::Base.supported_formats + end end module Generators diff --git a/lib/middleman/features/slickmap.rb b/lib/middleman/features/slickmap.rb index 3e50d878..33b8f71e 100644 --- a/lib/middleman/features/slickmap.rb +++ b/lib/middleman/features/slickmap.rb @@ -6,7 +6,6 @@ rescue LoadError end if Middleman::Base.environment == "build" - require "middleman/builder" Middleman::Builder.template :slickmap, "sitemap.html", "sitemap.html" end