Skip to content

Commit

Permalink
Merge pull request #23 from facelessuser/bugfix/glob-chars
Browse files Browse the repository at this point in the history
Handle special glob characters in path
  • Loading branch information
facelessuser committed Nov 21, 2022
2 parents 581e6b0 + 72645c1 commit 80b1b25
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions .dictionary
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ SVG
Twemoji
accessor
dedent
glob
inlined
inlining
macOS
Expand Down
4 changes: 4 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 1.1.1

- **FIX**: Properly handle special glob characters in path.

## 1.1.0

- **NEW**: Drop Python 3.6 and officially support 3.10.
Expand Down
2 changes: 1 addition & 1 deletion materialx/__meta__.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,5 +188,5 @@ def parse_version(ver):
return Version(major, minor, micro, release, pre, post, dev)


__version_info__ = Version(1, 1, 0, "final")
__version_info__ = Version(1, 1, 1, "final")
__version__ = __version_info__._get_canonical()
2 changes: 1 addition & 1 deletion materialx/emoji.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def _patch_index_for_locations(icon_locations):
# Find our icons
for icon_path in icon_locations:
norm_base = icon_path.replace('\\', '/') + '/'
for result in glob.glob(icon_path.replace('\\', '/') + '/**/*.svg', recursive=True):
for result in glob.glob(glob.escape(icon_path.replace('\\', '/')) + '/**/*.svg', recursive=True):
name = ':{}:'.format(result.replace('\\', '/').replace(norm_base, '', 1).replace('/', '-').lstrip('.')[:-4])
if name not in index['emoji'] and name not in index['aliases']:
# Easiest to just store the path and pull it out from the index
Expand Down

0 comments on commit 80b1b25

Please sign in to comment.