fix: subpackages.all works for root packages (#530) (#531)

This commit is contained in:
Kilian Funk 2024-07-12 14:36:14 -07:00 committed by GitHub
parent 27d429d8d0
commit 32bbb52730
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 1 deletions

View File

@ -62,7 +62,10 @@ def _all(exclude = [], allow_empty = False, fully_qualified = True):
return subs return subs
def _fully_qualified(relative_path): def _fully_qualified(relative_path):
return "//%s/%s" % (native.package_name(), relative_path) package_name = native.package_name()
if package_name:
return "//%s/%s" % (package_name, relative_path)
return "//" + relative_path
def _exists(relative_path): def _exists(relative_path):
"""Checks to see if relative_path is a direct subpackage of the current package. """Checks to see if relative_path is a direct subpackage of the current package.