fix: exit with proper error code on errors (#4806)

This commit is contained in:
Dmitry Molotkov 2019-01-19 15:49:57 +03:00 committed by Pooya Parsa
parent 25fd1d8dfc
commit a7ba73ed13
5 changed files with 17 additions and 1 deletions

View File

@ -24,3 +24,7 @@ require('@babel/register')({
const suffix = require('../package.json').name.includes('-edge') ? '-edge' : ''
require('@nuxt/cli' + suffix).run()
.catch((error) => {
require('consola').fatal(error)
process.exit(2)
})

View File

@ -6,3 +6,7 @@ if (process.argv[2] !== 'start') {
const suffix = require('../package.json').name.includes('-edge') ? '-edge' : ''
require('@nuxt/cli' + suffix).run()
.catch((error) => {
require('consola').fatal(error)
process.exit(2)
})

View File

@ -12,3 +12,7 @@ require('ts-node').register({
const suffix = require('../package.json').name.includes('-edge') ? '-edge' : ''
require('@nuxt/cli' + suffix).run()
.catch((error) => {
require('consola').fatal(error)
process.exit(2)
})

View File

@ -2,3 +2,7 @@
const suffix = require('../package.json').name.includes('-edge') ? '-edge' : ''
require('@nuxt/cli' + suffix).run()
.catch((error) => {
require('consola').fatal(error)
process.exit(2)
})

View File

@ -3,5 +3,5 @@
require('../dist/cli.js').run()
.catch((error) => {
require('consola').fatal(error)
process.exit(1)
process.exit(2)
})