Make glob recursive if option is enabled (#8783)

This commit is contained in:
Raul Bocanegra Algarra 2021-10-13 18:13:18 +02:00 committed by GitHub
parent 3c8c0ae725
commit e47ed057a5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -120,7 +120,7 @@ class generate_py_protobufs(Command):
if self.proto_files is None:
files = glob.glob(os.path.join(self.source_dir, '*.proto'))
if self.recurse:
files.extend(glob.glob(os.path.join(self.source_dir, '**', '*.proto')))
files.extend(glob.glob(os.path.join(self.source_dir, '**', '*.proto'), recursive=True))
self.proto_files = [f.partition(self.proto_root_path + os.path.sep)[-1] for f in files]
if not self.proto_files:
raise DistutilsOptionError('no .proto files were found under ' + self.source_dir)