Skip to content

Commit

Permalink
Merge pull request #590 from nanoc/auto-prune-by-default
Browse files Browse the repository at this point in the history
Auto-prune by default
  • Loading branch information
denisdefreyne committed May 17, 2015
2 parents 3006154 + 5b11961 commit c60ac54
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/nanoc/cli/commands/create-site.rb
Expand Up @@ -48,8 +48,8 @@ def array_to_yaml(array)
prune:
# Whether to automatically remove files not managed by nanoc from the output
# directory. For safety reasons, this is turned off by default.
auto_prune: false
# directory.
auto_prune: true
# Which files and directories you want to exclude from pruning. If you version
# your output directory, you should probably exclude VCS directories such as
Expand Down
14 changes: 14 additions & 0 deletions test/cli/commands/test_create_site.rb
Expand Up @@ -95,4 +95,18 @@ def test_new_site_has_correct_stylesheets
assert_match(/\/stylesheet.css/, File.read('output/index.html'))
end
end

def test_new_site_prunes_by_default
FileUtils.mkdir('foo')
FileUtils.touch(File.join('foo', 'SomeFile.txt'))
Nanoc::CLI.run %w( create_site foo --force )

FileUtils.cd('foo') do
File.write('output/blah.txt', 'stuff')

Nanoc::CLI.run %w( compile )

refute File.file?('output/blah.txt')
end
end
end

0 comments on commit c60ac54

Please sign in to comment.