Files
bet/common/utils.py
2025-10-25 13:24:17 +08:00

11 lines
245 B
Python

import os
def ensure_directory_exists(target_path: str, is_file: bool = False):
directory = target_path
if is_file:
directory = os.path.dirname(target_path)
if not os.path.exists(directory):
os.makedirs(directory)