优化路径判断逻辑

This commit is contained in:
puke
2025-11-09 21:55:10 +08:00
parent abc611e4de
commit c8bece859f

View File

@@ -476,8 +476,9 @@ class WindowsPackageBuilder:
path_str = str(path.relative_to(self.project_root)) path_str = str(path.relative_to(self.project_root))
for pattern in exclude_patterns: for pattern in exclude_patterns:
if pattern.endswith('/*'): if pattern.endswith('/*'):
# Directory content exclusion # Directory content exclusion - must match exact directory name or start with "dirname/"
if path_str.startswith(pattern[:-2]): dir_name = pattern[:-2]
if path_str == dir_name or path_str.startswith(f"{dir_name}/"):
return True return True
elif pattern.endswith('*'): elif pattern.endswith('*'):
# Wildcard pattern # Wildcard pattern