mirror of
https://github.com/derrod/legendary.git
synced 2026-05-07 06:23:22 +00:00
Fastpath for existing path case
"Fastpath", heh, get it, because it's working with paths...
This commit is contained in:
parent
a5da89c1c2
commit
3534730006
|
|
@ -25,6 +25,9 @@ def case_insensitive_file_search(path: str) -> str:
|
|||
Similar to case_insensitive_path_search: Finds a file case-insensitively
|
||||
Note that this *does* work on Windows, although it's rather pointless
|
||||
"""
|
||||
if os.path.exists(path):
|
||||
return path
|
||||
|
||||
path_parts = os.path.normpath(path).split(os.sep)
|
||||
# If path_parts[0] is empty, we're on Unix and thus start searching at /
|
||||
if not path_parts[0]:
|
||||
|
|
|
|||
Loading…
Reference in a new issue