Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 4 additions & 11 deletions nibabies/cli/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ def _build_parser():

deprecations = {
# parser attribute name: (replacement flag, version slated to be removed in)
'clean_workdir',
(None, '26.0.0'),
}

class DeprecatedAction(Action):
Expand Down Expand Up @@ -633,10 +635,9 @@ def _str_none(val):
)
g_other.add_argument(
'--clean-workdir',
action='store_true',
action=DeprecatedAction,
default=False,
help='Clears working directory of contents. Use of this flag is not'
'recommended when running concurrent processes of NiBabies.',
help='Deprecated and has no effect.',
)
g_other.add_argument(
'--resource-monitor',
Expand Down Expand Up @@ -857,14 +858,6 @@ def parse_args(args=None, namespace=None):
# Ensure the directory is created
config.execution.mcribs_dir.mkdir(exist_ok=True, parents=True)

# Wipe out existing work_dir
if opts.clean_workdir and work_dir.exists():
from niworkflows.utils.misc import clean_directory

build_log.info(f'Clearing previous NiBabies working directory: {work_dir}')
if not clean_directory(work_dir):
build_log.warning(f'Could not clear all contents of working directory: {work_dir}')

# Ensure input and output folders are not the same
if output_dir == bids_dir:
parser.error(
Expand Down