diff --git a/CHANGELOG.md b/CHANGELOG.md index 0b486428..f3594a8f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ master === +* "middleman build" will clean out old files from the build directory by default now, without needing to pass "--clean". Pass "--no-clean" to disable. #862 * Allow frontmatter to be side-loaded from a neighboring file with a .frontmatter extension: #855 * Allow frontmatter "renderer_options" key to overwrite renderer options on a per-file basis. #859 * A custom :partials_dir may be configured, and partials will be looked up from it. #854 diff --git a/middleman-core/lib/middleman-core/cli/build.rb b/middleman-core/lib/middleman-core/cli/build.rb index 772eb674..f1ce7b70 100644 --- a/middleman-core/lib/middleman-core/cli/build.rb +++ b/middleman-core/lib/middleman-core/cli/build.rb @@ -15,10 +15,10 @@ module Middleman::Cli namespace :build desc "build [options]", "Builds the static site for deployment" - method_option :no_clean, + method_option :clean, :type => :boolean, - :default => false, - :desc => 'Do not remove orphaned files from build' + :default => true, + :desc => 'Remove orphaned files from build (--no-clean to disable)' method_option :glob, :type => :string, :aliases => "-g", @@ -59,7 +59,7 @@ module Middleman::Cli opts = {} opts[:glob] = options["glob"] if options.has_key?("glob") - opts[:clean] = !options["no_clean"] if options.has_key?("no_clean") + opts[:clean] = options["clean"] if options.has_key?("clean") action GlobAction.new(self, opts)