Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
return async function buildNativeModules() {
let versionResult = await spawnAsync(electron, ['--version']);
let electronVersion = /v(\d+\.\d+\.\d+)/.exec(versionResult.stdout)[1];
logger.info(`Rebuilding native Node modules for Electron ${electronVersion}...`);
await rebuild(
path.resolve(paths.app),
electronVersion,
/* arch */ undefined,
/* extraModules */ undefined,
force
);
};
},
await asyncOra('Preparing native dependencies', async (rebuildSpinner) => {
const rebuilder = rebuild({
...config,
buildPath,
electronVersion,
arch,
});
const { lifecycle } = rebuilder;
let found = 0;
let done = 0;
const redraw = () => {
rebuildSpinner.text = `Preparing native dependencies: ${done} / ${found}`;
};
lifecycle.on('module-found', () => { found += 1; redraw(); });
lifecycle.on('module-done', () => { done += 1; redraw(); });
(buildPath, electronVersion, pPlatform, pArch, done) => rebuild(buildPath, electronVersion, pArch).then(() => done()).catch(done),
(buildPath, electronVersion, pPlatform, pArch, done) => {