Skip to content

Commit

Permalink
fix: avoid runtime error by reference to undefined variable
Browse files Browse the repository at this point in the history
Signed-off-by: ktro2828 <[email protected]>
  • Loading branch information
ktro2828 committed Sep 19, 2024
1 parent 644a768 commit 3e8da87
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,13 @@ def convert(self):
output_dir = output_dir / "t4_dataset"
if self._input_bag_base is not None:
input_bag_dir = Path(self._input_bag_base) / t4dataset_name

if osp.exists(output_dir):
logger.error(f"{output_dir} already exists.")
is_dir_exist = True
else:
is_dir_exist = False

if self._overwrite_mode or not is_dir_exist:
# Remove existing output directory
shutil.rmtree(output_dir, ignore_errors=True)
Expand Down

0 comments on commit 3e8da87

Please sign in to comment.