fix: exit process with non-zero code on error

pull/136/head
Evan You 4 years ago
parent 241e71000d
commit fb09f8e638

@ -22,13 +22,16 @@ if (!command || command === 'dev') {
}) })
.catch((err) => { .catch((err) => {
console.error(chalk.red(`failed to start server. error:\n`), err) console.error(chalk.red(`failed to start server. error:\n`), err)
process.exit(1)
}) })
} else if (command === 'build') { } else if (command === 'build') {
require('../dist/node') require('../dist/node')
.build(argv) .build(argv)
.catch((err) => { .catch((err) => {
console.error(chalk.red(`build error:\n`), err) console.error(chalk.red(`build error:\n`), err)
process.exit(1)
}) })
} else { } else {
console.log(chalk.red(`unknown command "${command}".`)) console.log(chalk.red(`unknown command "${command}".`))
process.exit(1)
} }

Loading…
Cancel
Save