mirror of
https://github.com/deadc0de6/dotdrop.git
synced 2026-02-16 21:24:10 +00:00
Fix special case of blank path and pattern
This commit is contained in:
@@ -17,9 +17,9 @@ import itertools
|
|||||||
import shutil
|
import shutil
|
||||||
import json
|
import json
|
||||||
import sys
|
import sys
|
||||||
|
from pathlib import PurePath
|
||||||
import requests
|
import requests
|
||||||
from packaging import version
|
from packaging import version
|
||||||
from pathlib import PurePath
|
|
||||||
|
|
||||||
# local import
|
# local import
|
||||||
from dotdrop.logger import Logger
|
from dotdrop.logger import Logger
|
||||||
@@ -232,7 +232,11 @@ def _match_ignore_pattern(path, pattern, debug=False):
|
|||||||
be able to match pattern like "*/dir"
|
be able to match pattern like "*/dir"
|
||||||
"""
|
"""
|
||||||
subpath = path
|
subpath = path
|
||||||
while subpath != PurePath(path).anchor:
|
|
||||||
|
# Account for Windows paths
|
||||||
|
drive = PurePath(path).drive
|
||||||
|
|
||||||
|
while subpath.lstrip(drive) != os.path.sep:
|
||||||
# if debug:
|
# if debug:
|
||||||
# msg = f'fnmatch \"{subpath}\" against {pattern}'
|
# msg = f'fnmatch \"{subpath}\" against {pattern}'
|
||||||
# LOG.dbg(msg, force=True)
|
# LOG.dbg(msg, force=True)
|
||||||
|
|||||||
Reference in New Issue
Block a user