def _cli_dir_arg(path: str) -> Path: """Check if dir exists and creates it if not.""" dir_path = Path(path) if not pathtools.dir_exists(dir_path): pathtools.create_dir(dir_path) return dir_path
def create_cache_dir(self) -> None: if not self.cache_dir_exists(): pathtools.create_dir(self.cache_dir) detailed_logger.info(".fastacache directory was created.") else: detailed_logger.warning( ".fastacache directory not created, as it already exists.")
def get_default_output_dir(): """Creates timestamped child dir under current working directory.""" current_dir = pathtools.get_cwd() current_time = pathtools.get_current_time() output_dir_name = "_".join(["output/", current_time]) output_dir_path = pathtools.get_child_path(current_dir, output_dir_name) pathtools.create_dir(output_dir_path) return output_dir_path