Skip to content

Commit

Permalink
Fixed issue where relative paths were returned by Include glob expres…
Browse files Browse the repository at this point in the history
…sions

Fixed issue where Include glob expressions were always recursive
  • Loading branch information
fireundubh committed Jun 15, 2021
1 parent efc0bc6 commit f551d2a
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions pyro/PackageManager.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class PackageManager:
pak_extension: str = ''
zip_extension: str = ''

DEFAULT_GLFLAGS = glob.NODIR | glob.MATCHBASE | glob.SPLIT | glob.REALPATH | glob.GLOBSTAR | glob.FOLLOW | glob.IGNORECASE | glob.MINUSNEGATE
DEFAULT_GLFLAGS = glob.NODIR | glob.MATCHBASE | glob.SPLIT | glob.REALPATH | glob.FOLLOW | glob.IGNORECASE | glob.MINUSNEGATE
DEFAULT_WCFLAGS = wcmatch.SYMLINKS | wcmatch.IGNORECASE | wcmatch.MINUSNEGATE

def __init__(self, ppj: PapyrusProject) -> None:
Expand Down Expand Up @@ -93,8 +93,8 @@ def _generate_include_paths(includes_node: etree.ElementBase, root_path: str, zi
if '*' in search_path:
for include_path in glob.iglob(search_path,
root_dir=root_path,
flags=PackageManager.DEFAULT_GLFLAGS):
yield include_path, attr_path
flags=PackageManager.DEFAULT_GLFLAGS | glob.GLOBSTAR if not attr_no_recurse else 0x0):
yield os.path.join(root_path, include_path), attr_path

elif not os.path.isabs(search_path):
test_path = os.path.normpath(os.path.join(root_path, search_path))
Expand All @@ -107,8 +107,8 @@ def _generate_include_paths(includes_node: etree.ElementBase, root_path: str, zi
else:
for include_path in glob.iglob(search_path,
root_dir=root_path,
flags=PackageManager.DEFAULT_GLFLAGS):
yield include_path, attr_path
flags=PackageManager.DEFAULT_GLFLAGS | glob.GLOBSTAR if not attr_no_recurse else 0x0):
yield os.path.join(root_path, include_path), attr_path

# populate files list using absolute paths
else:
Expand Down

0 comments on commit f551d2a

Please sign in to comment.