@ -182,16 +182,13 @@ function start() {
function ( next ) {
function ( next ) {
require ( './src/meta' ) . configs . init ( next ) ;
require ( './src/meta' ) . configs . init ( next ) ;
} ,
} ,
function ( next ) {
return next ( new Error ( 'dependencies-out-of-date' ) ) ;
} ,
function ( next ) {
function ( next ) {
require ( './src/upgrade' ) . check ( next ) ;
require ( './src/upgrade' ) . check ( next ) ;
} ,
} ,
function ( schema _ok , next ) {
function ( next ) {
if ( ! schema _ok && nconf . get ( 'check-schema' ) !== false ) {
winston . warn ( 'Your NodeBB schema is out-of-date. Please run the following command to bring your dataset up to spec:' ) ;
winston . warn ( ' ./nodebb upgrade' ) ;
process . exit ( ) ;
return ;
}
var webserver = require ( './src/webserver' ) ;
var webserver = require ( './src/webserver' ) ;
require ( './src/socket.io' ) . init ( webserver . server ) ;
require ( './src/socket.io' ) . init ( webserver . server ) ;
@ -204,12 +201,25 @@ function start() {
}
}
] , function ( err ) {
] , function ( err ) {
if ( err ) {
if ( err ) {
if ( err . stacktrace !== false ) {
switch ( err . message ) {
winston . error ( err . stack ) ;
case 'schema-out-of-date' :
} else {
winston . warn ( 'Your NodeBB schema is out-of-date. Please run the following command to bring your dataset up to spec:' ) ;
winston . error ( err . message ) ;
winston . warn ( ' ./nodebb upgrade' ) ;
break ;
case 'dependencies-out-of-date' :
winston . warn ( 'One or more of NodeBB\'s dependent packages are out-of-date. Please run the following command to update them:' ) ;
winston . warn ( ' ./nodebb upgrade' ) ;
break ;
default :
if ( err . stacktrace !== false ) {
winston . error ( err . stack ) ;
} else {
winston . error ( err . message ) ;
}
break ;
}
}
// Either way, bad stuff happened. Abort start.
process . exit ( ) ;
process . exit ( ) ;
}
}
} ) ;
} ) ;