MCPcopy Create free account
hub / github.com/doldecomp/mkdd / check_path_case

Function check_path_case

tools/project.py:323–350  ·  view source on GitHub ↗
(path: Path)

Source from the content-addressed store, hash-verified

321
322
323def check_path_case(path: Path):
324 parts = path.parts
325 if path.is_absolute():
326 curr = Path(parts[0])
327 start = 1
328 else:
329 curr = Path(".")
330 start = 0
331
332 for part in parts[start:]:
333 if curr in _listdir_cache:
334 entries = _listdir_cache[curr]
335 else:
336 try:
337 entries = os.listdir(curr)
338 except (FileNotFoundError, PermissionError):
339 sys.exit(f"Cannot access: {curr}")
340 _listdir_cache[curr] = entries
341
342 for entry in entries:
343 if entry.lower() == part.lower():
344 curr = curr / entry
345 break
346 else:
347 sys.exit(f"Cannot resolve: {path}")
348
349 if path != curr:
350 print(f"⚠️ Case mismatch: expected={path} actual={curr}")
351
352
353def make_flags_str(flags: Optional[List[str]]) -> str:

Callers 1

add_unitFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected