Skip to content

Commit

Permalink
Respect --project-dir in dbt clean command
Browse files Browse the repository at this point in the history
  • Loading branch information
feluelle committed Oct 19, 2020
1 parent 7203825 commit 3c8bb9f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion core/dbt/task/clean.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import os
import shutil

from dbt.task.base import BaseTask
from dbt.task.base import BaseTask, move_to_nearest_project_dir
from dbt.logger import GLOBAL_LOGGER as logger
from dbt.config import UnsetProfileConfig

Expand Down Expand Up @@ -32,6 +32,7 @@ def run(self):
This function takes all the paths in the target file
and cleans the project paths that are not protected.
"""
move_to_nearest_project_dir(self.args)
for path in self.config.clean_targets:
logger.info("Checking {}/*".format(path))
if not self.__is_protected_path(path):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,3 +168,4 @@ def _run_simple_dbt_commands(self, project_dir):
self.run_dbt(['seed', '--project-dir', project_dir])
self.run_dbt(['run', '--project-dir', project_dir])
self.run_dbt(['test', '--project-dir', project_dir])
self.run_dbt(['clean', '--project-dir', project_dir])

0 comments on commit 3c8bb9f

Please sign in to comment.