Skip to content

Commit

Permalink
Fix doit clean (#2980)
Browse files Browse the repository at this point in the history
* Use doit clean as required by doit 0.31
  • Loading branch information
ralsina authored and Kwpolska committed Mar 31, 2018
1 parent e8f38ca commit 46f343d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions nikola/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,13 +244,14 @@ def __init__(self, *args, **kw):
class Clean(DoitClean):
"""Clean site, including the cache directory."""

def clean_tasks(self, tasks, dryrun):
# The unseemly *a is because this API changed between doit 0.30.1 and 0.31
def clean_tasks(self, tasks, dryrun, *a):
"""Clean tasks."""
if not dryrun and config:
cache_folder = config.get('CACHE_FOLDER', 'cache')
if os.path.exists(cache_folder):
shutil.rmtree(cache_folder)
return super(Clean, self).clean_tasks(tasks, dryrun)
return super(Clean, self).clean_tasks(tasks, dryrun, *a)


# Nikola has its own "auto" commands that uses livereload.
Expand Down

0 comments on commit 46f343d

Please sign in to comment.