Merge pull request #6530 from theotherjimmy/exclude-dot-files

Exclude files like `.main.cpp` from builds
pull/6564/head
Jimmy Brisson 2018-04-06 10:45:26 -05:00 committed by GitHub
commit 192a8e5094
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 2 deletions

View File

@ -731,12 +731,13 @@ class mbedToolchain:
# A helper function for both scan_resources and _add_dir. _add_file adds one file
# (*file_path*) to the resources object based on the file type.
def _add_file(self, file_path, resources, base_path, exclude_paths=None):
resources.file_basepath[file_path] = base_path
if self.is_ignored(relpath(file_path, base_path)):
if (self.is_ignored(relpath(file_path, base_path)) or
basename(file_path).startswith(".")):
resources.ignore_dir(relpath(file_path, base_path))
return
resources.file_basepath[file_path] = base_path
_, ext = splitext(file_path)
ext = ext.lower()