Skip to content

Commit 5045e96

Browse files
authored
Merge pull request #32 from Extend-Robotics/ERD-1633_find_cmake_project_names_ignore_hidden_dirs
ignore hidden dirs
2 parents 51ab692 + 2984afb commit 5045e96

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

bin/find_cmake_project_names.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,13 @@ def _find_project_name_from_cmakelists(lines):
5656
print(f"Error: The path '{root_path}' is not a directory.")
5757
sys.exit(1)
5858

59+
IGNORED_DIRECTORY_PREFIXES = ('.', '__pycache__')
60+
5961
project_names = []
6062
for dirpath, dirnames, filenames in os.walk(root_path):
63+
dirnames[:] = [
64+
d for d in dirnames if not d.startswith(IGNORED_DIRECTORY_PREFIXES)
65+
]
6166
if 'CMakeLists.txt' in filenames:
6267
cmakelists_path = os.path.join(dirpath, 'CMakeLists.txt')
6368
with open(cmakelists_path, 'r') as file:

0 commit comments

Comments
 (0)