mirror of
https://github.com/hellodigua/ChatLab.git
synced 2026-10-26 02:04:37 +08:00
fix(cli): download official prebuilds when preparing better-sqlite3
prebuild-install was invoked with -r napi, but better-sqlite3 only publishes per-ABI node/electron prebuilds, so the download branch always failed and every run fell back to a ~1.5min node-gyp source build. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
74971c624a
commit
9503fc18cb
1 file changed
+4
-2
@@ -1,8 +1,9 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# 在隔离目录中编译 better-sqlite3 的系统 Node.js 原生模块,
|
||||
# 在隔离目录中准备 better-sqlite3 的系统 Node.js 原生模块,
|
||||
# 避免与 electron-rebuild 产生冲突。
|
||||
#
|
||||
# 优先下载官方 Node ABI 预编译包(秒级),无可用预编译时回退源码编译。
|
||||
# 产物:apps/cli/native/better_sqlite3.node
|
||||
#
|
||||
set -e
|
||||
@@ -23,7 +24,8 @@ npm init -y > /dev/null 2>&1
|
||||
npm install "better-sqlite3@${BS3_VERSION}" --ignore-scripts > /dev/null 2>&1
|
||||
|
||||
cd "node_modules/better-sqlite3"
|
||||
npx --yes prebuild-install -r napi || npm run build-release 2>/dev/null || npx --yes node-gyp rebuild --release
|
||||
# better-sqlite3 按 Node ABI 发布预编译(无 napi 变体),与其自身 install 脚本保持一致
|
||||
npx --yes prebuild-install || npm run build-release 2>/dev/null || npx --yes node-gyp rebuild --release
|
||||
|
||||
BUILT="$TEMP_DIR/node_modules/better-sqlite3/build/Release/better_sqlite3.node"
|
||||
if [ ! -f "$BUILT" ]; then
|
||||
|
||||
Reference in new issue
Block a user