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
582 B
23 lines
582 B
5 years ago
|
#!/usr/bin/env node
|
||
|
|
||
|
const childProcess = require('child_process');
|
||
|
const ora = require('ora');
|
||
|
|
||
|
const timeout = 1000 * 60 * 2;
|
||
|
const buildCommand = `npm run build`;
|
||
|
|
||
|
function prePublish(packageAlias, packagePath) {
|
||
|
const spinner = ora(`Building "${packageAlias}" library`).start();
|
||
|
|
||
|
try {
|
||
|
childProcess.execSync(buildCommand, { timeout, cwd: packagePath });
|
||
|
} catch (error) {
|
||
|
spinner.fail(`Could not finish building "${packageAlias}" library`);
|
||
|
process.exit();
|
||
|
}
|
||
|
|
||
|
spinner.succeed(`Finished building "${packageAlias}" library`);
|
||
|
}
|
||
|
|
||
|
module.exports = prePublish;
|