updated install script to accept environment variables

updated upgrade script to execute callback when present
updated install script to not fire upgrades unless necessary
updated install script to write directly to console, and not through winston
if a password is not provided, one is auto-generated
This commit is contained in:
Julian Lam
2015-04-22 10:27:54 -04:00
parent 828980f3e6
commit b604c9d5e1
3 changed files with 80 additions and 28 deletions

View File

@@ -971,23 +971,25 @@ Upgrade.upgrade = function(callback) {
} else {
winston.info('[upgrade] Schema already up to date!');
}
process.exit();
} else {
switch(err.message) {
case 'upgrade-not-possible':
winston.error('[upgrade] NodeBB upgrade could not complete, as your database schema is too far out of date.');
winston.error('[upgrade] Please ensure that you did not skip any minor version upgrades.');
winston.error('[upgrade] (e.g. v0.1.x directly to v0.3.x)');
process.exit();
break;
default:
winston.error('[upgrade] Errors were encountered while updating the NodeBB schema: ' + err.message);
process.exit();
break;
}
}
if (typeof callback === 'function') {
callback(err);
} else {
process.exit();
}
});
};