mirror of
https://github.com/tiddly-gittly/TidGi-Desktop.git
synced 2025-12-06 02:30:47 -08:00
fix: registry-js not copied
This commit is contained in:
parent
45e3f76da1
commit
5152284b3e
1 changed files with 16 additions and 3 deletions
|
|
@ -18,7 +18,7 @@ import path from 'path';
|
|||
export default (
|
||||
buildPath: string,
|
||||
_electronVersion: string,
|
||||
_platform: string,
|
||||
platform: string,
|
||||
_arch: string,
|
||||
callback: () => void,
|
||||
): void => {
|
||||
|
|
@ -46,8 +46,6 @@ export default (
|
|||
['tiddlywiki', 'plugins', 'tiddlywiki', 'filesystem'],
|
||||
['tiddlywiki', 'plugins', 'tiddlywiki', 'tiddlyweb'],
|
||||
['tiddlywiki', 'tiddlywiki.js'],
|
||||
// we only need its `main` binary, no need its dependency and code, because we already copy it to src/services/native/externalApp
|
||||
['app-path', 'main'],
|
||||
// node binary
|
||||
['better-sqlite3', 'build', 'Release', 'better_sqlite3.node'],
|
||||
// nsfw native module
|
||||
|
|
@ -59,6 +57,11 @@ export default (
|
|||
[`sqlite-vec-${process.platform === 'win32' ? 'windows' : process.platform}-${process.arch}`],
|
||||
];
|
||||
|
||||
// macOS only: copy app-path binary for finding apps
|
||||
if (platform === 'darwin') {
|
||||
packagePathsToCopyDereferenced.push(['app-path', 'main']);
|
||||
}
|
||||
|
||||
console.log('Copying packagePathsToCopyDereferenced');
|
||||
for (const packagePathInNodeModules of packagePathsToCopyDereferenced) {
|
||||
// some binary may not exist in other platforms, so allow failing here.
|
||||
|
|
@ -84,6 +87,16 @@ export default (
|
|||
path.join(cwd, 'node_modules', 'dugite'),
|
||||
{ dereference: false },
|
||||
);
|
||||
|
||||
if (platform === 'win32') {
|
||||
console.log('Copy registry-js (Windows only)');
|
||||
// registry-js has native binary that is loaded using relative path (../../build/Release/registry.node)
|
||||
fs.copySync(
|
||||
path.join(sourceNodeModulesFolder, 'registry-js'),
|
||||
path.join(cwd, 'node_modules', 'registry-js'),
|
||||
{ dereference: true },
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/** complete this hook */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue