MCPcopy Index your code
hub / github.com/colbymchenry/codegraph / extract

Function extract

scripts/npm-shim.js:221–228  ·  view source on GitHub ↗
(archive, destDir)

Source from the content-addressed store, hash-verified

219// Extract via the system tar — present on macOS, Linux, and Windows 10+
220// (bsdtar reads .zip too). No third-party dependency in the shim.
221function extract(archive, destDir) {
222 var args = isWindows
223 ? ['-xf', archive, '-C', destDir, '--strip-components=1']
224 : ['-xzf', archive, '-C', destDir, '--strip-components=1'];
225 var res = childProcess.spawnSync('tar', args, { stdio: 'ignore', windowsHide: true });
226 if (res.error) throw new Error('tar unavailable: ' + res.error.message);
227 if (res.status !== 0) throw new Error('tar exited ' + res.status);
228}
229
230function rmrf(p) {
231 try { fs.rmSync(p, { recursive: true, force: true }); } catch (e) { /* best effort */ }

Callers 1

selfHealBundleFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected