MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / extractExactTarArchive

Function extractExactTarArchive

pkg/npm/install.js:93–108  ·  view source on GitHub ↗
(
  archivePath, destPath, expectedNames, targetName, runFile = execFileSync,
)

Source from the content-addressed store, hash-verified

91}
92
93function extractExactTarArchive(
94 archivePath, destPath, expectedNames, targetName, runFile = execFileSync,
95) {
96 const listing = runFile('tar', ['-tzf', archivePath], {
97 encoding: 'utf8',
98 maxBuffer: MAX_CHECKSUM_MANIFEST_BYTES,
99 windowsHide: true,
100 });
101 validateExactTarMemberListing(listing, expectedNames);
102 // Extract only the fixed root executable. Even a malformed tar implementation
103 // cannot write an unvalidated companion member outside the private temp tree.
104 runFile('tar', ['-xzf', archivePath, '-C', destPath, targetName], {
105 stdio: 'inherit',
106 windowsHide: true,
107 });
108}
109
110function downloadHop(url, dest, maxBytes) {
111 return new Promise((resolve, reject) => {

Callers 2

mainFunction · 0.85

Calls 1

Tested by

no test coverage detected