MCPcopy Index your code
hub / github.com/nodejs/node / find_single_subdir

Function find_single_subdir

tools/prepare_lief.py:44–51  ·  view source on GitHub ↗
(root: Path)

Source from the content-addressed store, hash-verified

42 extracted_dir.rename(target_dir)
43
44def find_single_subdir(root: Path) -> Path:
45 entries = [p for p in root.iterdir() if p.is_dir()]
46 if len(entries) == 1:
47 return entries[0]
48 # Try to pick the most likely one by name length (zip usually extracts into a single dir)
49 if entries:
50 return sorted(entries, key=lambda p: len(p.name))[0]
51 return root
52
53
54def cmake_configure_in(template: str, values: dict) -> str:

Callers

nothing calls this directly

Calls 1

sortedFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…