Skip to content

Commit

Permalink
Merge pull request #2060 from emilieschario/dev/0.15.1
Browse files Browse the repository at this point in the history
Add logging for a file path that can't be cleaned
  • Loading branch information
drewbanin authored Jan 27, 2020
2 parents 96a9c6c + 199b1ed commit 73c418c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion core/dbt/task/clean.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def __is_protected_path(self, path):
abs_path = os.path.abspath(path)
protected_paths = self.config.source_paths + \
self.config.test_paths + ['.']
protected_abs_paths = [os.path.abspath for p in protected_paths]
protected_abs_paths = [os.path.abspath(p) for p in protected_paths]
return abs_path in set(protected_abs_paths) or \
self.__is_project_path(abs_path)

Expand All @@ -35,4 +35,7 @@ def run(self):
if not self.__is_protected_path(path):
shutil.rmtree(path, True)
logger.info(" Cleaned {}/*".format(path))
else:
logger.info("ERROR: not cleaning {}/* because it is "
"protected".format(path))
logger.info("Finished cleaning all paths.")

0 comments on commit 73c418c

Please sign in to comment.