Skip to content

Commit

Permalink
Fix special case of blank path and pattern
Browse files Browse the repository at this point in the history
  • Loading branch information
shyun3 authored and deadc0de6 committed Oct 24, 2024
1 parent d25eae4 commit c51ac6f
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions dotdrop/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
import shutil
import json
import sys
from pathlib import PurePath
import requests
from packaging import version
from pathlib import PurePath

# local import
from dotdrop.logger import Logger
Expand Down Expand Up @@ -232,7 +232,11 @@ def _match_ignore_pattern(path, pattern, debug=False):
be able to match pattern like "*/dir"
"""
subpath = path
while subpath != PurePath(path).anchor:

# Account for Windows paths
drive = PurePath(path).drive

while subpath.lstrip(drive) != os.path.sep:
# if debug:
# msg = f'fnmatch \"{subpath}\" against {pattern}'
# LOG.dbg(msg, force=True)
Expand Down

0 comments on commit c51ac6f

Please sign in to comment.