Skip to content

Commit

Permalink
fix #2017
Browse files Browse the repository at this point in the history
  • Loading branch information
ralsina committed Jul 19, 2016
1 parent f47705f commit 7b47c27
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGES.txt
Expand Up @@ -16,6 +16,7 @@ Features
Bugfixes
--------

* Warn about possible outdated files after --clean-files (Issue #2017)
* Improved EXIF orientation handling
* Register post list template as a dependency (Issue #2391)
* Fix section color hashing when using Python 2
Expand Down
7 changes: 7 additions & 0 deletions nikola/plugins/command/check.py
Expand Up @@ -417,6 +417,8 @@ def clean_files(self):
self.logger.debug('removed: {0}'.format(f))
os.unlink(f)

warn_flag = bool(only_on_output)

# Find empty directories and remove them
output_folder = self.site.config['OUTPUT_FOLDER']
all_dirs = []
Expand All @@ -427,6 +429,11 @@ def clean_files(self):
try:
os.rmdir(d)
self.logger.debug('removed: {0}/'.format(d))
warn_flag = True
except OSError:
pass

if warn_flag:
self.logger.warn('Some files or directories have been removed, your site may need rebuilding')

return True

0 comments on commit 7b47c27

Please sign in to comment.