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:
parent
8648aaed7c
commit
167b213a07
2 changed files with 6 additions and 1 deletions
|
@ -13,3 +13,8 @@ Feature: Build Clean
|
||||||
Then "about/index.html" should exist at "clean-dir-app"
|
Then "about/index.html" should exist at "clean-dir-app"
|
||||||
Given a built app at "clean-dir-app" with flags "--clean"
|
Given a built app at "clean-dir-app" with flags "--clean"
|
||||||
Then "about/index.html" should exist at "clean-dir-app"
|
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"
|
||||||
|
|
|
@ -138,7 +138,7 @@ module Middleman
|
||||||
unless path == destination
|
unless path == destination
|
||||||
@cleaning_queue << path.sub(@destination, destination[/([^\/]+?)$/])
|
@cleaning_queue << path.sub(@destination, destination[/([^\/]+?)$/])
|
||||||
end
|
end
|
||||||
end
|
end if File.exist?(@destination)
|
||||||
end
|
end
|
||||||
|
|
||||||
def execute!
|
def execute!
|
||||||
|
|
Loading…
Reference in a new issue