INNER CODE UNIT · Python
make_outdir
widdowquinn/pyani · pyani/scripts/__init__.py:21
def make_outdir(outdir: Path, force: bool, noclobber: bool) -> None:
"""Create output directory (allows for force and noclobber).
:param outdir: Path, path to output directory
:param force: bool, True if an existing directory will be reused
:param noclobber: bool, True if existing files are not overwritten
The intended outcomes are:
outdir doesn't exist: create outdir
outdir exists: raise exception
outdir exists, --force only: remove the directory tree
outdir exists, --force --noclobber: continue with existing directory tree
So long as the outdir is created with this function, we need only check
for args.noclobber elsewhere to see how to proceed when a file exists.
"""
# Create logger
logger = logging.getLogger(__name__)