Skip to content

Commit

Permalink
fix: wrap build to try-catch
Browse files Browse the repository at this point in the history
  • Loading branch information
yarastqt committed Oct 26, 2020
1 parent 160bb47 commit 0f8213c
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/cli/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,14 @@ export default class Build extends Command {
}

private async build(config: any) {
console.log(`----------------- ${chalk.yellow('Build started')} -----------------`)
await build(config)
console.log(`\n---------------- ${chalk.green('Build completed')} ----------------`)
console.log(`>---------------- ${chalk.yellow('Build started')} ----------------<`)
try {
await build(config)
console.log(`\n>--------------- ${chalk.green('Build completed')} ---------------<`)
} catch (error) {
console.log(error)
console.log(`\n>---------------- ${chalk.red('Build failed')} -----------------<`)
}
}

private emitWatching() {
Expand Down

0 comments on commit 0f8213c

Please sign in to comment.