MCPcopy Create free account
hub / github.com/Pagghiu/SaneCppLibraries / cleanup_layout

Function cleanup_layout

Tools/Support/PortableMSVCDownloader.py:215–240  ·  view source on GitHub ↗
(destination: Path)

Source from the content-addressed store, hash-verified

213
214
215def cleanup_layout(destination: Path):
216 for path in (
217 destination / "Common7",
218 destination / "VC" / "Auxiliary",
219 ):
220 shutil.rmtree(path, ignore_errors=True)
221
222 msvc_roots = sorted((destination / "VC" / "Tools" / "MSVC").glob("*"))
223 if msvc_roots:
224 msvc_root = msvc_roots[0]
225 for subdirectory in (
226 msvc_root / "lib" / "x64" / "store",
227 msvc_root / "lib" / "x64" / "uwp",
228 ):
229 shutil.rmtree(subdirectory, ignore_errors=True)
230
231 sdk_bins = sorted((destination / "Windows Kits" / "10" / "bin").glob("*"))
232 if sdk_bins:
233 sdk_root = sdk_bins[0]
234 for path in (
235 destination / "Windows Kits" / "10" / "Catalogs",
236 destination / "Windows Kits" / "10" / "DesignTime",
237 destination / "Windows Kits" / "10" / "bin" / sdk_root.name / "chpe",
238 destination / "Windows Kits" / "10" / "Lib" / sdk_root.name / "ucrt_enclave",
239 ):
240 shutil.rmtree(path, ignore_errors=True)
241
242
243def resolve_first_subdirectory(path: Path):

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected