Files
HappyOnigiri-ComfyUI-Meld/check_scripts/utils.py
T
HappyOnigiri 248f21c975 fix(lint): improve css lint scripts and remove duplicate ignores
- Extract shared directory resolution to check_scripts/utils.py
- Refine check_unused_css regex to accurately match className attribute values without broad character windows
- Deduplicate adjacent unused-css-check-ignore comments in base.css
2026-03-04 09:23:21 +09:00

22 lines
723 B
Python

import os
import sys
def resolve_search_path() -> tuple[str, str, str]:
"""Resolves and validates the search directories, returning (base_dir, target_dir, search_path)."""
target_dir = os.path.join("ui", "src")
base_dir = os.getcwd()
search_path = os.path.join(base_dir, target_dir)
if not os.path.exists(search_path):
if os.path.basename(base_dir) == "ui":
search_path = os.path.join(base_dir, "src")
if not os.path.exists(search_path):
print(f"Directory not found: {search_path}")
sys.exit(1)
else:
print(f"Directory not found: {search_path}")
sys.exit(1)
return base_dir, target_dir, search_path