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

Function extractExactTarArchive

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

Source from the content-addressed store, hash-verified

209}
210
211async function extractExactTarArchive(
212 archivePath, destPath, expectedNames, targetName,
213 runFile = execFileSync, spawnFile = spawn,
214) {
215 requireRegularArchive(archivePath);
216 // The exact root namespace is the member bound: the listing must name
217 // exactly the expected root files.
218 const listing = runFile('tar', ['-tzf', archivePath], {
219 encoding: 'utf8',
220 windowsHide: true,
221 });
222 validateExactTarMemberListing(listing, expectedNames);
223 // Only the fixed root executable is ever written; the companions are
224 // listed but never extracted.
225 const target = path.join(destPath, targetName);
226 await extractTarMember(archivePath, target, targetName, spawnFile);
227 fs.chmodSync(target, 0o755);
228}
229
230function downloadHop(url, dest, loopback) {
231 return new Promise((resolve, reject) => {

Callers 3

mainFunction · 0.85

Calls 3

extractTarMemberFunction · 0.85
requireRegularArchiveFunction · 0.70

Tested by

no test coverage detected