Skip to content

Commit ec6dc62

Browse files
authored
Merge pull request #473 from nipreps/mnt/deprecate-clean-workdir
maint: deprecate `--clean-workdir`
2 parents d008a41 + 8c9cbb9 commit ec6dc62

File tree

1 file changed

+4
-11
lines changed

1 file changed

+4
-11
lines changed

nibabies/cli/parser.py

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ def _build_parser():
3131

3232
deprecations = {
3333
# parser attribute name: (replacement flag, version slated to be removed in)
34+
'clean_workdir',
35+
(None, '26.0.0'),
3436
}
3537

3638
class DeprecatedAction(Action):
@@ -633,10 +635,9 @@ def _str_none(val):
633635
)
634636
g_other.add_argument(
635637
'--clean-workdir',
636-
action='store_true',
638+
action=DeprecatedAction,
637639
default=False,
638-
help='Clears working directory of contents. Use of this flag is not'
639-
'recommended when running concurrent processes of NiBabies.',
640+
help='Deprecated and has no effect.',
640641
)
641642
g_other.add_argument(
642643
'--resource-monitor',
@@ -857,14 +858,6 @@ def parse_args(args=None, namespace=None):
857858
# Ensure the directory is created
858859
config.execution.mcribs_dir.mkdir(exist_ok=True, parents=True)
859860

860-
# Wipe out existing work_dir
861-
if opts.clean_workdir and work_dir.exists():
862-
from niworkflows.utils.misc import clean_directory
863-
864-
build_log.info(f'Clearing previous NiBabies working directory: {work_dir}')
865-
if not clean_directory(work_dir):
866-
build_log.warning(f'Could not clear all contents of working directory: {work_dir}')
867-
868861
# Ensure input and output folders are not the same
869862
if output_dir == bids_dir:
870863
parser.error(

0 commit comments

Comments
 (0)