From 2984afbe3eb819434ff876ac27e8eb42c7be452c Mon Sep 17 00:00:00 2001 From: tomqext Date: Thu, 26 Feb 2026 00:05:04 +0000 Subject: [PATCH] ignore hidden dirs --- bin/find_cmake_project_names.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/bin/find_cmake_project_names.py b/bin/find_cmake_project_names.py index 6413a01..f66c95e 100644 --- a/bin/find_cmake_project_names.py +++ b/bin/find_cmake_project_names.py @@ -56,8 +56,13 @@ def _find_project_name_from_cmakelists(lines): print(f"Error: The path '{root_path}' is not a directory.") sys.exit(1) +IGNORED_DIRECTORY_PREFIXES = ('.', '__pycache__') + project_names = [] for dirpath, dirnames, filenames in os.walk(root_path): + dirnames[:] = [ + d for d in dirnames if not d.startswith(IGNORED_DIRECTORY_PREFIXES) + ] if 'CMakeLists.txt' in filenames: cmakelists_path = os.path.join(dirpath, 'CMakeLists.txt') with open(cmakelists_path, 'r') as file: