diff --git a/dcm2bids/utils/args.py b/dcm2bids/utils/args.py index 1266e4aa..cbe8164e 100644 --- a/dcm2bids/utils/args.py +++ b/dcm2bids/utils/args.py @@ -28,12 +28,12 @@ def check(path: Path): "could be overwritten or deleted.\nRerun the command " "with --force option to overwrite " "existing output files.") - else: - for child in path.iterdir(): - if child.is_file(): - os.remove(child) - elif child.is_dir(): - shutil.rmtree(child) + else: + for child in path.iterdir(): + if child.is_file(): + os.remove(child) + elif child.is_dir(): + shutil.rmtree(child) if isinstance(required, str): required = Path(required)