Skip to content

Commit 13812aa

Browse files
committed
fix(build): simplify pre-download script and update .vscodeignore
The pre-download script was simplified to remove unnecessary file existence checks and improve file cleanup. Additionally, the .vscodeignore file was updated to include specific build artifacts.
1 parent 2c133af commit 13812aa

File tree

2 files changed

+8
-15
lines changed

2 files changed

+8
-15
lines changed

.vscodeignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -46,4 +46,5 @@ CHANGELOG.md
4646
bin
4747
tsconfig.node.json
4848
pre-download-build.js
49-
docs
49+
docs
50+
bin/**/build.tar.gz

pre-download-build.js

+6-14
Original file line numberDiff line numberDiff line change
@@ -45,25 +45,17 @@ for (const target of targets) {
4545
const downloadUrl = `https://github.com/TryGhost/node-sqlite3/releases/download/v5.1.7/sqlite3-v5.1.7-napi-v6-${
4646
target === "win32-arm64" ? "win32-ia32" : target
4747
}.tar.gz`;
48-
// 检查下载文件是否存在
49-
const filePath = `${targetDir}/build.tar.gz`;
50-
if (fs.existsSync(filePath)) {
51-
console.log(`[info] File already exists: ${filePath}`);
52-
} else {
53-
// 如果文件不存在,下载文件
54-
console.log(`[info] Downloading ${target}...`);
55-
execSync(`curl -L -o ${targetDir}/build.tar.gz ${downloadUrl}`);
56-
}
48+
execSync(`curl -L -o ${targetDir}/build.tar.gz ${downloadUrl}`);
5749
execSync(`cd ${targetDir} && tar -xvzf build.tar.gz`);
5850
fs.copyFileSync(
5951
`${targetDir}/build/Release/node_sqlite3.node`,
6052
`${targetDir}/node_sqlite3.node`,
6153
);
62-
// fs.unlinkSync(`${targetDir}/build.tar.gz`);
63-
// fs.rmSync(`${targetDir}/build`, {
64-
// recursive: true,
65-
// force: true,
66-
// });
54+
fs.unlinkSync(`${targetDir}/build.tar.gz`);
55+
fs.rmSync(`${targetDir}/build`, {
56+
recursive: true,
57+
force: true,
58+
});
6759
}
6860

6961
console.log("[info] Downloading prebuilt lancedb...");

0 commit comments

Comments
 (0)