You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
656 B
23 lines
656 B
3 years ago
|
import path from 'path';
|
||
|
import { execSync } from 'child_process';
|
||
|
import fs from 'fs';
|
||
|
import { dependencies } from '../../src/package.json';
|
||
|
|
||
|
const nodeModulesPath = path.join(__dirname, '../../src/node_modules');
|
||
|
|
||
|
if (
|
||
|
Object.keys(dependencies || {}).length > 0 &&
|
||
|
fs.existsSync(nodeModulesPath)
|
||
|
) {
|
||
|
const electronRebuildCmd =
|
||
|
'../node_modules/.bin/electron-rebuild --parallel --force --types prod,dev,optional --module-dir .';
|
||
|
const cmd =
|
||
|
process.platform === 'win32'
|
||
|
? electronRebuildCmd.replace(/\//g, '\\')
|
||
|
: electronRebuildCmd;
|
||
|
execSync(cmd, {
|
||
|
cwd: path.join(__dirname, '../../src'),
|
||
|
stdio: 'inherit',
|
||
|
});
|
||
|
}
|