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 <noreply@anthropic.com>
This commit is contained in:
1 parent
b819eb7601
commit
0bf97a3795
1 file changed
+6
-4
@@ -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: <appOutDir>/CodePilot.app/Contents/Resources/standalone/...
|
||||
// But appOutDir might already point to the .app parent, so try both
|
||||
// macOS: <appOutDir>/CodePilot.app/Contents/Resources/standalone/...
|
||||
// Windows/Linux: <appOutDir>/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;
|
||||
|
||||
Reference in new issue
Block a user