Merge pull request #862 from middleman/default_clean_true
Default build to --clean
This commit is contained in:
commit
daf1756300
|
@ -2,14 +2,14 @@ Feature: Build Clean
|
||||||
Scenario: Build and Clean an app
|
Scenario: Build and Clean an app
|
||||||
Given a fixture app "clean-app"
|
Given a fixture app "clean-app"
|
||||||
And app "clean-app" is using config "empty"
|
And app "clean-app" is using config "empty"
|
||||||
And a successfully built app at "clean-app"
|
And a successfully built app at "clean-app" with flags "--no-clean"
|
||||||
Then the following files should exist:
|
Then the following files should exist:
|
||||||
| build/index.html |
|
| build/index.html |
|
||||||
| build/should_be_ignored.html |
|
| build/should_be_ignored.html |
|
||||||
| build/should_be_ignored2.html |
|
| build/should_be_ignored2.html |
|
||||||
| build/should_be_ignored3.html |
|
| build/should_be_ignored3.html |
|
||||||
And app "clean-app" is using config "complications"
|
And app "clean-app" is using config "complications"
|
||||||
Given a successfully built app at "clean-app" with flags "--clean"
|
Given a successfully built app at "clean-app"
|
||||||
Then the following files should not exist:
|
Then the following files should not exist:
|
||||||
| build/should_be_ignored.html |
|
| build/should_be_ignored.html |
|
||||||
| build/should_be_ignored2.html |
|
| build/should_be_ignored2.html |
|
||||||
|
@ -17,12 +17,11 @@ Feature: Build Clean
|
||||||
And the file "build/index.html" should contain "Comment in layout"
|
And the file "build/index.html" should contain "Comment in layout"
|
||||||
|
|
||||||
Scenario: Clean build an app with newly ignored files and a nested output directory
|
Scenario: Clean build an app with newly ignored files and a nested output directory
|
||||||
Given a built app at "clean-nested-app"
|
Given a built app at "clean-nested-app" with flags "--no-clean"
|
||||||
Then a directory named "sub/dir" should exist
|
Then a directory named "sub/dir" should exist
|
||||||
Then the following files should exist:
|
Then the following files should exist:
|
||||||
| sub/dir/about.html |
|
| sub/dir/about.html |
|
||||||
When I append to "config.rb" with "ignore 'about.html'"
|
When I append to "config.rb" with "ignore 'about.html'"
|
||||||
Given a built app at "clean-nested-app" with flags "--clean"
|
Given a built app at "clean-nested-app"
|
||||||
Then the following files should not exist:
|
Then the following files should not exist:
|
||||||
| sub/dir/about.html |
|
| sub/dir/about.html |
|
||||||
|
|
||||||
|
|
|
@ -15,11 +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 :clean,
|
method_option :no_clean,
|
||||||
:type => :boolean,
|
:type => :boolean,
|
||||||
:aliases => "-c",
|
|
||||||
:default => false,
|
:default => false,
|
||||||
:desc => 'Removes orphaned files or directories from build'
|
:desc => 'Do not remove orphaned files from build'
|
||||||
method_option :glob,
|
method_option :glob,
|
||||||
:type => :string,
|
:type => :string,
|
||||||
:aliases => "-g",
|
:aliases => "-g",
|
||||||
|
@ -60,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["clean"] if options.has_key?("clean")
|
opts[:clean] = !options["no_clean"] if options.has_key?("no_clean")
|
||||||
|
|
||||||
action GlobAction.new(self, opts)
|
action GlobAction.new(self, opts)
|
||||||
|
|
||||||
|
|
|
@ -1,14 +1,14 @@
|
||||||
Feature: Build Clean
|
Feature: Build Clean
|
||||||
|
|
||||||
Scenario: Clean an app with directory indexes
|
Scenario: Clean an app with directory indexes
|
||||||
Given a successfully built app at "clean-dir-app"
|
Given a successfully built app at "clean-dir-app" with flags "--no-clean"
|
||||||
Then the following files should exist:
|
Then the following files should exist:
|
||||||
| build/about/index.html |
|
| build/about/index.html |
|
||||||
Given a successfully built app at "clean-dir-app" with flags "--clean"
|
Given a successfully built app at "clean-dir-app"
|
||||||
Then the following files should exist:
|
Then the following files should exist:
|
||||||
| build/about/index.html |
|
| build/about/index.html |
|
||||||
|
|
||||||
Scenario: Clean build an app that's never been built
|
Scenario: Clean build an app that's never been built
|
||||||
Given a successfully built app at "clean-dir-app" with flags "--clean"
|
Given a successfully built app at "clean-dir-app"
|
||||||
Then the following files should exist:
|
Then the following files should exist:
|
||||||
| build/about/index.html |
|
| build/about/index.html |
|
Loading…
Reference in a new issue