MCPcopy Create free account
hub / github.com/continuedev/continue / downloadNodeSqlite

Function downloadNodeSqlite

binary/utils/bundle-binary.js:17–41  ·  view source on GitHub ↗
(target, targetDir)

Source from the content-addressed store, hash-verified

15const { fork } = require("child_process");
16
17async function downloadNodeSqlite(target, targetDir) {
18 const [currentPlatform, currentArch] = autodetectPlatformAndArch();
19
20 // Download and unzip prebuilt sqlite3 binary for the target
21 console.log("[info] Downloading node-sqlite3");
22
23 await downloadSqlite(target, `${targetDir}/build.tar.gz`);
24
25 execCmdSync(`cd ${targetDir} && tar -xvzf build.tar.gz`);
26
27 // Copy to build directory for testing
28 try {
29 const [platform, arch] = target.split("-");
30 if (platform === currentPlatform && arch === currentArch) {
31 fs.copyFileSync(
32 `${targetDir}/build/Release/node_sqlite3.node`,
33 `build/node_sqlite3.node`,
34 );
35 }
36 } catch (error) {
37 console.log("[warn] Could not copy node_sqlite to build");
38 console.log(error);
39 }
40 fs.unlinkSync(`${targetDir}/build.tar.gz`);
41}
42
43/**
44 * @param {string} target the platform to build for

Callers 1

bundleForBinaryFunction · 0.85

Calls 4

downloadSqliteFunction · 0.85
execCmdSyncFunction · 0.85
logMethod · 0.65

Tested by

no test coverage detected