forked from olcxjas-softworks/LarpixClient
update electron to v43
This commit is contained in:
parent
68ac0beedf
commit
fb6c8b6ee9
5385 changed files with 513060 additions and 123058 deletions
31
electron/node_modules/@electron/rebuild/lib/electron-locator.js
generated
vendored
Normal file
31
electron/node_modules/@electron/rebuild/lib/electron-locator.js
generated
vendored
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
import fs from 'node:fs';
|
||||
import path from 'node:path';
|
||||
import { searchForModule } from './search-module.js';
|
||||
import { fileURLToPath } from 'node:url';
|
||||
const electronModuleNames = ['electron', 'electron-prebuilt-compile'];
|
||||
async function locateModuleByImport() {
|
||||
for (const moduleName of electronModuleNames) {
|
||||
try {
|
||||
const modulePath = path.resolve(fileURLToPath(import.meta.resolve(`${moduleName}/package.json`)), '..');
|
||||
if (fs.existsSync(path.join(modulePath, 'package.json'))) {
|
||||
return modulePath;
|
||||
}
|
||||
}
|
||||
catch {
|
||||
// eslint-disable-line no-empty
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
export async function locateElectronModule(projectRootPath, startDir) {
|
||||
startDir ??= process.cwd();
|
||||
for (const moduleName of electronModuleNames) {
|
||||
const electronPaths = await searchForModule(startDir, moduleName, projectRootPath);
|
||||
const electronPath = electronPaths.find((ePath) => fs.existsSync(path.join(ePath, 'package.json')));
|
||||
if (electronPath) {
|
||||
return electronPath;
|
||||
}
|
||||
}
|
||||
return locateModuleByImport();
|
||||
}
|
||||
//# sourceMappingURL=electron-locator.js.map
|
||||
Loading…
Add table
Add a link
Reference in a new issue