Make glob recursive if option is enabled (#8783)
This commit is contained in:
parent
3c8c0ae725
commit
e47ed057a5
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user