mirror of
https://github.com/abhigyanpatwari/GitNexus.git
synced 2026-09-24 00:51:53 +00:00
feat(desktop): improve native module rebuild process by checking for runtime package.json
Co-authored-by: Copilot <copilot@github.com>
This commit is contained in:
parent
610a102397
commit
13eeab4601
1 changed files with 9 additions and 1 deletions
|
|
@ -286,17 +286,25 @@ const rebuildPackagedNativeModules = () => {
|
|||
for (const resourceRoot of resourceRoots) {
|
||||
const packagedRuntimeRoot = path.join(resourceRoot, 'gitnexus');
|
||||
const packagedNodeModulesRoot = path.join(packagedRuntimeRoot, 'node_modules');
|
||||
const packagedRuntimePackageJson = path.join(packagedRuntimeRoot, 'package.json');
|
||||
|
||||
if (!fs.existsSync(packagedNodeModulesRoot)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!fs.existsSync(packagedRuntimePackageJson)) {
|
||||
console.warn(
|
||||
`[build] skipping native module rebuild because runtime package.json is missing at ${packagedRuntimePackageJson}`,
|
||||
);
|
||||
continue;
|
||||
}
|
||||
|
||||
const rebuildCommand = [
|
||||
`npx --yes -p @electron/rebuild@${electronRebuildVersion} electron-rebuild`,
|
||||
'--force',
|
||||
'--types prod,optional',
|
||||
`--version "${electronVersion}"`,
|
||||
`--module-dir "${packagedNodeModulesRoot}"`,
|
||||
`--module-dir "${packagedRuntimeRoot}"`,
|
||||
process.platform === 'win32' ? '--sequential' : '',
|
||||
]
|
||||
.filter(Boolean)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue