oak-domain/scripts/make.ts

39 lines
1.1 KiB
TypeScript

import chalk from 'chalk';
import spawn from 'cross-spawn';
import { resolve } from 'path';
// ts-node scripts/build-app-domain & npm link ./app-domain
console.log(`${chalk.greenBright(`build base-app-domain`)}`);
let result = spawn.sync(
'ts-node',
[resolve(process.cwd(), 'scripts', 'buildBaseEntityDict.ts')],
{
stdio: 'inherit',
shell: true,
}
);
// const result2 = spawn.sync('npm -v', [], { stdio: 'inherit', shell: true });
if (result.status !== 0) {
Error(`${chalk.redBright(`build base-app-domain 执行失败`)}`);
process.exit(1);
}
console.log(`${chalk.greenBright(`build base-app-domain 执行完成`)}`);
console.log(`${chalk.greenBright(`build locales`)}`);
result = spawn.sync(
'ts-node',
[resolve(process.cwd(), 'scripts', 'buildLocales.ts')],
{
stdio: 'inherit',
shell: true,
}
);
// const result2 = spawn.sync('npm -v', [], { stdio: 'inherit', shell: true });
if (result.status !== 0) {
Error(`${chalk.redBright(`build locales 执行失败`)}`);
process.exit(1);
}
console.log(`${chalk.greenBright(`build locales 执行完成`)}`);