Fix build --clean when the build directory doesn't exist.

Before this fix, "build --clean" with no build directory would do
nothing. Now it behaves just like a normal build.
This commit is contained in:
Ben Hollis 2011-11-30 22:55:09 -08:00
parent 8648aaed7c
commit 167b213a07
2 changed files with 6 additions and 1 deletions

View file

@ -13,3 +13,8 @@ Feature: Build Clean
Then "about/index.html" should exist at "clean-dir-app"
Given a built app at "clean-dir-app" with flags "--clean"
Then "about/index.html" should exist at "clean-dir-app"
Then cleanup built app at "clean-dir-app"
Scenario: Clean build an app that's never been built
Given a built app at "clean-dir-app" with flags "--clean"
Then "about/index.html" should exist at "clean-dir-app"

View file

@ -138,7 +138,7 @@ module Middleman
unless path == destination
@cleaning_queue << path.sub(@destination, destination[/([^\/]+?)$/])
end
end
end if File.exist?(@destination)
end
def execute!