Skip to content

Commit

Permalink
fix: exit process with non-zero code on error
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 committed Nov 19, 2020
1 parent 241e710 commit fb09f8e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions bin/vitepress.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,16 @@ if (!command || command === 'dev') {
})
.catch((err) => {
console.error(chalk.red(`failed to start server. error:\n`), err)
process.exit(1)
})
} else if (command === 'build') {
require('../dist/node')
.build(argv)
.catch((err) => {
console.error(chalk.red(`build error:\n`), err)
process.exit(1)
})
} else {
console.log(chalk.red(`unknown command "${command}".`))
process.exit(1)
}

0 comments on commit fb09f8e

Please sign in to comment.