MCPcopy Create free account
hub / github.com/OpenHands/OpenHands / extract

Function extract

scripts/download-node.mjs:143–154  ·  view source on GitHub ↗
(archivePath, targetDir, ext)

Source from the content-addressed store, hash-verified

141// ── Extraction ───────────────────────────────────────────────────────────────
142
143function extract(archivePath, targetDir, ext) {
144 // Both tar.gz and zip extract via system `tar`:
145 // GNU/BSD tar (macOS/Linux) handles .tar.gz natively.
146 // bsdtar (Windows 10+) handles both .tar.gz and .zip.
147 // --strip-components=1 drops the "node-vX.Y.Z-<platform>-<arch>/" top dir.
148 void ext; // archive content is identified by tar's own magic bytes
149 execFileSync(
150 "tar",
151 ["-xf", archivePath, "-C", targetDir, "--strip-components=1"],
152 { stdio: "inherit" },
153 );
154}
155
156function ensureExecutable(p) {
157 if (process.platform === "win32") return;

Callers 1

mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected