mirror of
https://github.com/Zagrios/bs-manager.git
synced 2026-07-03 14:08:25 +02:00
14 lines
604 B
JavaScript
14 lines
604 B
JavaScript
import { execSync } from "child_process";
|
|
import fs from "fs";
|
|
import { dependencies } from "../../release/app/package.json";
|
|
import webpackPaths from "../configs/webpack.paths";
|
|
|
|
if (Object.keys(dependencies || {}).length > 0 && fs.existsSync(webpackPaths.appNodeModulesPath)) {
|
|
const electronRebuildCmd = "../../node_modules/.bin/electron-rebuild --force --types prod,dev,optional --module-dir .";
|
|
const cmd = process.platform === "win32" ? electronRebuildCmd.replace(/\//g, "\\") : electronRebuildCmd;
|
|
execSync(cmd, {
|
|
cwd: webpackPaths.appPath,
|
|
stdio: "inherit",
|
|
});
|
|
}
|