This commit is contained in:
2025-10-25 13:24:17 +08:00
parent 54e9d05778
commit 5593442534

10
common/utils.py Normal file
View File

@@ -0,0 +1,10 @@
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)