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.
25 lines
730 B
25 lines
730 B
8 years ago
|
// @flow
|
||
|
// Check if the renderer and main bundles are built
|
||
|
import path from 'path';
|
||
|
import chalk from 'chalk';
|
||
|
import fs from 'fs';
|
||
|
|
||
|
function CheckBuildsExist() {
|
||
|
const mainPath = path.join(__dirname, '..', '..', 'app', 'main.prod.js');
|
||
|
const rendererPath = path.join(__dirname, '..', '..', 'app', 'dist', 'renderer.prod.js');
|
||
|
|
||
|
if (!fs.existsSync(mainPath)) {
|
||
|
throw new Error(chalk.whiteBright.bgRed.bold(
|
||
|
'The main process is not built yet. Build it by running "npm run build-main"'
|
||
|
));
|
||
|
}
|
||
|
|
||
|
if (!fs.existsSync(rendererPath)) {
|
||
|
throw new Error(chalk.whiteBright.bgRed.bold(
|
||
|
'The renderer process is not built yet. Build it by running "npm run build-renderer"'
|
||
|
));
|
||
|
}
|
||
|
}
|
||
|
|
||
|
CheckBuildsExist();
|