From 0bf97a3795584f2f4ea3719c2cbc2b1dbf20a031 Mon Sep 17 00:00:00 2001 From: 7418 <7418@openclaw.ai> Date: Sat, 7 Feb 2026 14:28:38 +0800 Subject: [PATCH] fix: support Windows/Linux paths in afterPack hook The afterPack script only searched macOS-specific paths (CodePilot.app/Contents/Resources) for better_sqlite3.node replacement. Add Windows/Linux path (resources/standalone/) so the native module ABI fix works on all platforms. Co-Authored-By: Claude Opus 4.6 --- scripts/after-pack.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/scripts/after-pack.js b/scripts/after-pack.js index ce174f3..d5bb86c 100644 --- a/scripts/after-pack.js +++ b/scripts/after-pack.js @@ -27,12 +27,14 @@ module.exports = async function afterPack(context) { } // Find all better_sqlite3.node files inside the standalone resources - const resourcesDir = path.join(appOutDir, 'CodePilot.app', 'Contents', 'Resources'); - // On macOS the structure is: /CodePilot.app/Contents/Resources/standalone/... - // But appOutDir might already point to the .app parent, so try both + // macOS: /CodePilot.app/Contents/Resources/standalone/... + // Windows/Linux: /resources/standalone/... const searchRoots = [ - path.join(resourcesDir, 'standalone'), + // macOS paths + path.join(appOutDir, 'CodePilot.app', 'Contents', 'Resources', 'standalone'), path.join(appOutDir, 'Contents', 'Resources', 'standalone'), + // Windows/Linux paths + path.join(appOutDir, 'resources', 'standalone'), ]; let replaced = 0;