Fix --clean option to not be an error if it is passed (for backwards compatibility)

This commit is contained in:
Ben Hollis 2013-04-13 18:58:54 -07:00
parent 6eb7ff72d3
commit a2822ce7f5
2 changed files with 5 additions and 4 deletions

View file

@ -1,6 +1,7 @@
master 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 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 * 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 * A custom :partials_dir may be configured, and partials will be looked up from it. #854

View file

@ -15,10 +15,10 @@ module Middleman::Cli
namespace :build namespace :build
desc "build [options]", "Builds the static site for deployment" desc "build [options]", "Builds the static site for deployment"
method_option :no_clean, method_option :clean,
:type => :boolean, :type => :boolean,
:default => false, :default => true,
:desc => 'Do not remove orphaned files from build' :desc => 'Remove orphaned files from build (--no-clean to disable)'
method_option :glob, method_option :glob,
:type => :string, :type => :string,
:aliases => "-g", :aliases => "-g",
@ -59,7 +59,7 @@ module Middleman::Cli
opts = {} opts = {}
opts[:glob] = options["glob"] if options.has_key?("glob") 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) action GlobAction.new(self, opts)