From a2822ce7f5c0bffb96d5a7b7a872ce6c45c12663 Mon Sep 17 00:00:00 2001 From: Ben Hollis Date: Sat, 13 Apr 2013 18:58:54 -0700 Subject: [PATCH] Fix --clean option to not be an error if it is passed (for backwards compatibility) --- CHANGELOG.md | 1 + middleman-core/lib/middleman-core/cli/build.rb | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) 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)